@@ -103,6 +103,7 @@ public class NavigationBarWidget extends UIWidget implements GeckoSession.Naviga
103
103
private HamburgerMenuWidget mHamburgerMenu ;
104
104
private SendTabDialogWidget mSendTabDialog ;
105
105
private TooltipWidget mPopUpNotification ;
106
+ private int mBlockedCount ;
106
107
107
108
public NavigationBarWidget (Context aContext ) {
108
109
super (aContext );
@@ -1190,11 +1191,29 @@ public void onPopUpAvailable() {
1190
1191
@ Override
1191
1192
public void onPopUpsCleared () {
1192
1193
mURLBar .setIsPopUpAvailable (false );
1194
+ hidePopUpsBlockedNotification ();
1193
1195
}
1194
1196
};
1195
1197
1196
1198
public void showPopUpsBlockedNotification () {
1197
- post (() -> showNotification (mURLBar .getPopUpButton (), R .string .popup_tooltip ));
1199
+ final int POP_UP_NOTIFICATION_DELAY = 800 ;
1200
+ mBlockedCount ++;
1201
+ final int currentCount = mBlockedCount ;
1202
+ postDelayed (() -> {
1203
+ if (currentCount == mBlockedCount ) {
1204
+ showNotification (mURLBar .getPopUpButton (), R .string .popup_tooltip );
1205
+ }
1206
+ }, POP_UP_NOTIFICATION_DELAY );
1207
+ }
1208
+
1209
+ public void hidePopUpsBlockedNotification () {
1210
+ mBlockedCount ++;
1211
+ final int currentCount = mBlockedCount ;
1212
+ post (() -> {
1213
+ if (currentCount == mBlockedCount ) {
1214
+ hideNotification (mURLBar .getPopUpButton ());
1215
+ }
1216
+ });
1198
1217
}
1199
1218
1200
1219
private void showNotification (UIButton button , int stringRes ) {
0 commit comments