Bug 1348735 - Add a separate accesskey for "Never For This Session" in web notification permission prompts. r=johannh draft
authorNihanth Subramanya <nhnt11@gmail.com>
Wed, 22 Mar 2017 06:41:06 +0530
changeset 502580 7abc12698944efc1a2416938d183395cc20da46f
parent 502579 8744e9f8eb99f1290aae81985812d57364f18708
child 550194 e50e797fff2a85019ef10e2d5f40f2bfdfa3a6ee
push id50322
push usernhnt11@gmail.com
push dateWed, 22 Mar 2017 01:11:55 +0000
reviewersjohannh
bugs1348735
milestone55.0a1
Bug 1348735 - Add a separate accesskey for "Never For This Session" in web notification permission prompts. r=johannh MozReview-Commit-ID: BW9auLhZ4i9
browser/locales/en-US/chrome/browser/browser.properties
browser/modules/PermissionUI.jsm
--- a/browser/locales/en-US/chrome/browser/browser.properties
+++ b/browser/locales/en-US/chrome/browser/browser.properties
@@ -492,18 +492,19 @@ geolocation.shareWithSite3=Will you allo
 geolocation.shareWithFile3=Will you allow this local file to access your location?
 geolocation.remember=Remember this decision
 
 webNotifications.allow=Allow Notifications
 webNotifications.allow.accesskey=A
 webNotifications.notNow=Not Now
 webNotifications.notNow.accesskey=n
 webNotifications.never=Never Allow
+webNotifications.never.accesskey=v
 webNotifications.neverForSession=Never For This Session
-webNotifications.never.accesskey=v
+webNotifications.neverForSession.accesskey=v
 webNotifications.receiveFromSite2=Will you allow %S to send notifications?
 # LOCALIZATION NOTE (webNotifications.upgradeTitle): When using native notifications on OS X, the title may be truncated around 32 characters.
 webNotifications.upgradeTitle=Upgraded notifications
 # LOCALIZATION NOTE (webNotifications.upgradeBody): When using native notifications on OS X, the body may be truncated around 100 characters in some views.
 webNotifications.upgradeBody=You can now receive notifications from sites that are not currently loaded. Click to learn more.
 
 # Phishing/Malware Notification Bar.
 # LOCALIZATION NOTE (notADeceptiveSite, notAnAttack)
--- a/browser/modules/PermissionUI.jsm
+++ b/browser/modules/PermissionUI.jsm
@@ -559,35 +559,37 @@ DesktopNotificationPermissionPrompt.prot
     try {
       hostPort = this.principal.URI.hostPort;
     } catch (ex) { }
     return gBrowserBundle.formatStringFromName("webNotifications.receiveFromSite2",
                                                [hostPort], 1);
   },
 
   get promptActions() {
+    let isBrowserPrivate = PrivateBrowsingUtils.isBrowserPrivate(this.browser);
     return [
       {
         label: gBrowserBundle.GetStringFromName("webNotifications.allow"),
         accessKey:
           gBrowserBundle.GetStringFromName("webNotifications.allow.accesskey"),
         action: SitePermissions.ALLOW,
         scope: SitePermissions.SCOPE_PERSISTENT,
       },
       {
         label: gBrowserBundle.GetStringFromName("webNotifications.notNow"),
         accessKey:
           gBrowserBundle.GetStringFromName("webNotifications.notNow.accesskey"),
         action: SitePermissions.BLOCK,
       },
       {
-        label: PrivateBrowsingUtils.isBrowserPrivate(this.browser) ?
+        label: isBrowserPrivate ?
           gBrowserBundle.GetStringFromName("webNotifications.neverForSession") :
           gBrowserBundle.GetStringFromName("webNotifications.never"),
-        accessKey:
+        accessKey: isBrowserPrivate ?
+          gBrowserBundle.GetStringFromName("webNotifications.neverForSession.accesskey") :
           gBrowserBundle.GetStringFromName("webNotifications.never.accesskey"),
         action: SitePermissions.BLOCK,
         scope: SitePermissions.SCOPE_PERSISTENT,
       },
     ];
   },
 };