From 9c6c8ba4ca7d262a2a51773dafe3a44f72b6f8c2 Mon Sep 17 00:00:00 2001 From: Margaret Leibovic Date: Wed, 6 Mar 2013 13:02:39 +0000 Subject: [PATCH] Bug 739757 - (Part 4) Update popup blocked notifications. r=mfinkle --- mobile/android/chrome/content/browser.js | 30 ++++++++++--------- .../locales/en-US/chrome/browser.properties | 10 +++---- 2 files changed, 21 insertions(+), 19 deletions(-) diff --git a/mobile/android/chrome/content/browser.js b/mobile/android/chrome/content/browser.js index 6ca2b1ffe3a5..bdda8d5298dd 100644 --- a/mobile/android/chrome/content/browser.js +++ b/mobile/android/chrome/content/browser.js @@ -5622,30 +5622,32 @@ var PopupBlockerObserver = { let strings = Strings.browser; if (popupCount > 1) - message = strings.formatStringFromName("popupWarningMultiple", [brandShortName, popupCount], 2); + message = strings.formatStringFromName("popup.warningMultiple", [brandShortName, popupCount], 2); else - message = strings.formatStringFromName("popupWarning", [brandShortName], 1); + message = strings.formatStringFromName("popup.warning", [brandShortName], 1); let buttons = [ { - label: strings.GetStringFromName("popupButtonAllowOnce"), - callback: function() { PopupBlockerObserver.showPopupsForSite(); } - }, - { - label: strings.GetStringFromName("popupButtonAlwaysAllow2"), - callback: function() { + label: strings.GetStringFromName("popup.show"), + callback: function(aChecked) { // Set permission before opening popup windows - PopupBlockerObserver.allowPopupsForSite(true); + if (aChecked) + PopupBlockerObserver.allowPopupsForSite(true); + PopupBlockerObserver.showPopupsForSite(); } }, { - label: strings.GetStringFromName("popupButtonNeverWarn2"), - callback: function() { PopupBlockerObserver.allowPopupsForSite(false); } + label: strings.GetStringFromName("popup.dontShow"), + callback: function(aChecked) { + if (aChecked) + PopupBlockerObserver.allowPopupsForSite(false); + } } ]; - NativeWindow.doorhanger.show(message, "popup-blocked", buttons); + let options = { checkbox: Strings.browser.GetStringFromName("popup.dontAskAgain") }; + NativeWindow.doorhanger.show(message, "popup-blocked", buttons, null, options); } // Record the fact that we've reported this blocked popup, so we don't // show it again. @@ -6411,8 +6413,8 @@ var PermissionsHelper = { }, "popup": { label: "blockPopups.label", - allowed: "popupButtonAlwaysAllow2", - denied: "popupButtonNeverWarn2" + allowed: "popup.show", + denied: "popup.dontShow" }, "indexedDB": { label: "offlineApps.storeOfflineData", diff --git a/mobile/android/locales/en-US/chrome/browser.properties b/mobile/android/locales/en-US/chrome/browser.properties index 91190b64d608..362c992cfc48 100644 --- a/mobile/android/locales/en-US/chrome/browser.properties +++ b/mobile/android/locales/en-US/chrome/browser.properties @@ -48,11 +48,11 @@ notificationRestart.blocked=Unsafe add-ons installed. Restart to disable. notificationRestart.button=Restart # Popup Blocker -popupWarning=%S prevented this site from opening a pop-up window. -popupWarningMultiple=%S prevented this site from opening %S pop-up windows. -popupButtonAllowOnce=Show -popupButtonAlwaysAllow2=Always Show -popupButtonNeverWarn2=Never Show +popup.warning=%S prevented this site from opening a pop-up window. Would you like to show it? +popup.warningMultiple=%S prevented this site from opening %S pop-up windows. Would you like to show them? +popup.dontAskAgain=Don't ask again for this site +popup.show=Show +popup.dontShow=Don't show # SafeBrowsing safeBrowsingDoorhanger=This site has been identified as containing malware or a phishing attempt. Be careful.