Bug 1219454 - Replace 'show' with 'receive' in about:permissions and control center for consistent messaging around notifications and to account for new Push permission. r=MattN
authorTanvi Vyas <tanvi@mozilla.com>
Wed, 28 Oct 2015 16:15:00 -0700
changeset 270062 33f17a45547f5fb873c7a8d74b1febb16c644a3e
parent 270061 b836b8feea9ee7b53475dd122ff388aa6fcd37f7
child 270063 cad376d2e71f1b7d58cee37a592597690093eb8a
push id15977
push usermozilla@noorenberghe.ca
push dateThu, 29 Oct 2015 08:50:29 +0000
treeherderfx-team@cad376d2e71f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMattN
bugs1219454
milestone44.0a1
Bug 1219454 - Replace 'show' with 'receive' in about:permissions and control center for consistent messaging around notifications and to account for new Push permission. r=MattN
browser/base/content/browser.xul
browser/components/preferences/aboutPermissions.xul
browser/locales/en-US/chrome/browser/browser.dtd
browser/locales/en-US/chrome/browser/preferences/aboutPermissions.dtd
browser/locales/en-US/chrome/browser/sitePermissions.properties
browser/modules/SitePermissions.jsm
--- a/browser/base/content/browser.xul
+++ b/browser/base/content/browser.xul
@@ -727,17 +727,17 @@
                        aria-label="&urlbar.loginFillNotificationAnchor.label;"/>
                 <image id="password-notification-icon" class="notification-anchor-icon" role="button"
                        aria-label="&urlbar.passwordNotificationAnchor.label;"/>
                 <image id="webapps-notification-icon" class="notification-anchor-icon" role="button"
                        aria-label="&urlbar.webappsNotificationAnchor.label;"/>
                 <image id="plugins-notification-icon" class="notification-anchor-icon" role="button"
                        aria-label="&urlbar.pluginsNotificationAnchor.label;"/>
                 <image id="web-notifications-notification-icon" class="notification-anchor-icon" role="button"
-                       aria-label="&urlbar.webNotsNotificationAnchor.label;"/>
+                       aria-label="&urlbar.webNotsNotificationAnchor2.label;"/>
                 <image id="webRTC-shareDevices-notification-icon" class="notification-anchor-icon" role="button"
                        aria-label="&urlbar.webRTCShareDevicesNotificationAnchor.label;"/>
                 <image id="webRTC-sharingDevices-notification-icon" class="notification-anchor-icon" role="button"
                        aria-label="&urlbar.webRTCSharingDevicesNotificationAnchor.label;"/>
                 <image id="webRTC-shareMicrophone-notification-icon" class="notification-anchor-icon" role="button"
                        aria-label="&urlbar.webRTCShareMicrophoneNotificationAnchor.label;"/>
                 <image id="webRTC-sharingMicrophone-notification-icon" class="notification-anchor-icon" role="button"
                        aria-label="&urlbar.webRTCSharingMicrophoneNotificationAnchor.label;"/>
--- a/browser/components/preferences/aboutPermissions.xul
+++ b/browser/components/preferences/aboutPermissions.xul
@@ -239,17 +239,17 @@
           </vbox>
         </hbox>
 
         <!-- Notifications -->
         <hbox id="desktop-notification-pref-item"
               class="pref-item" align="top">
           <image class="pref-icon" type="desktop-notification"/>
           <vbox>
-            <label class="pref-title" value="&desktop-notification.label;"/>
+            <label class="pref-title" value="&desktop-notification2.label;"/>
             <hbox align="center">
               <menulist id="desktop-notification-menulist"
                         class="pref-menulist"
                         type="desktop-notification"
                         oncommand="AboutPermissions.onPermissionCommand(event);">
                 <menupopup>
                   <menuitem id="desktop-notification-0" value="0" label="&permission.alwaysAsk;"/>
                   <menuitem id="desktop-notification-1" value="1" label="&permission.allow;"/>
--- a/browser/locales/en-US/chrome/browser/browser.dtd
+++ b/browser/locales/en-US/chrome/browser/browser.dtd
@@ -196,17 +196,17 @@ These should match what Safari and other
 <!ENTITY urlbar.defaultNotificationAnchor.label         "View a notification">
 <!ENTITY urlbar.geolocationNotificationAnchor.label     "View the location request">
 <!ENTITY urlbar.addonsNotificationAnchor.label          "View the add-on install message">
 <!ENTITY urlbar.indexedDBNotificationAnchor.label       "View the app-offline storage message">
 <!ENTITY urlbar.loginFillNotificationAnchor.label       "Manage your login information">
 <!ENTITY urlbar.passwordNotificationAnchor.label        "Check if you want to save your password">
 <!ENTITY urlbar.webappsNotificationAnchor.label         "View the app install message">
 <!ENTITY urlbar.pluginsNotificationAnchor.label         "Manage plugin usage on this page">
-<!ENTITY urlbar.webNotsNotificationAnchor.label         "Change whether the site can show you notifications">
+<!ENTITY urlbar.webNotsNotificationAnchor2.label        "Change whether the site can receive notifications">
 
 <!ENTITY urlbar.webRTCShareDevicesNotificationAnchor.label      "Manage sharing your camera and/or microphone with the site">
 <!ENTITY urlbar.webRTCSharingDevicesNotificationAnchor.label    "You are sharing your camera and/or microphone with the site">
 <!ENTITY urlbar.webRTCShareMicrophoneNotificationAnchor.label   "Manage sharing your microphone with the site">
 <!ENTITY urlbar.webRTCSharingMicrophoneNotificationAnchor.label "You are sharing your microphone with the site">
 <!ENTITY urlbar.webRTCShareScreenNotificationAnchor.label       "Manage sharing your windows or screen with the site">
 <!ENTITY urlbar.webRTCSharingScreenNotificationAnchor.label     "You are sharing a window or your screen with the site">
 
--- a/browser/locales/en-US/chrome/browser/preferences/aboutPermissions.dtd
+++ b/browser/locales/en-US/chrome/browser/preferences/aboutPermissions.dtd
@@ -36,13 +36,13 @@
 <!ENTITY plugins.label                   "Plugins">
 
 <!-- LOCALIZATION NOTE (indexedDB.label): This is describing indexedDB storage
      using the same language used for the permIndexedDB string in browser/pageInfo.dtd -->
 <!ENTITY indexedDB.label                 "Maintain Offline Storage">
 
 <!ENTITY popup.label                     "Open Pop-up Windows">
 
-<!ENTITY desktop-notification.label      "Show Notifications">
+<!ENTITY desktop-notification2.label     "Receive Notifications">
 <!ENTITY camera.label                    "Use the Camera">
 <!ENTITY microphone.label                "Use the Microphone">
 
 <!ENTITY focusSearch.key                 "f">
--- a/browser/locales/en-US/chrome/browser/sitePermissions.properties
+++ b/browser/locales/en-US/chrome/browser/sitePermissions.properties
@@ -3,17 +3,17 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 allow = Allow
 allowForSession = Allow for Session
 block = Block
 alwaysAsk = Always Ask
 
 permission.cookie.label = Set Cookies
-permission.desktop-notification.label = Show Notifications
+permission.desktop-notification2.label = Receive Notifications
 permission.image.label = Load Images
 permission.camera.label = Use the Camera
 permission.microphone.label = Use the Microphone
 permission.install.label = Install Add-ons
 permission.popup.label = Open Pop-up Windows
 permission.geo.label = Access Your Location
 permission.indexedDB.label = Maintain Offline Storage
 permission.pointerLock.label = Hide the Mouse Pointer
--- a/browser/modules/SitePermissions.jsm
+++ b/browser/modules/SitePermissions.jsm
@@ -95,17 +95,18 @@ this.SitePermissions = {
 
     Services.perms.remove(aURI, aPermissionID);
   },
 
   /* Returns the localized label for the permission with the given ID, to be
    * used in a UI for managing permissions.
    */
   getPermissionLabel: function (aPermissionID) {
-    return gStringBundle.GetStringFromName("permission." + aPermissionID + ".label");
+    let labelID = gPermissionObject[aPermissionID].labelID || aPermissionID;
+    return gStringBundle.GetStringFromName("permission." + labelID + ".label");
   },
 
   /* Returns the localized label for the given permission state, to be used in
    * a UI for managing permissions.
    */
   getStateLabel: function (aPermissionID, aState) {
     switch (aState) {
       case this.UNKNOWN:
@@ -131,16 +132,20 @@ var gPermissionObject = {
    *    Allows sub domains to have their own permissions.
    *    Defaults to false.
    *
    *  - getDefault
    *    Called to get the permission's default state.
    *    Defaults to UNKNOWN, indicating that the user will be asked each time
    *    a page asks for that permissions.
    *
+   *  - labelID
+   *    Use the given ID instead of the permission name for looking up strings.
+   *    e.g. "desktop-notification2" to use permission.desktop-notification2.label
+   *
    *  - states
    *    Array of permission states to be exposed to the user.
    *    Defaults to ALLOW, BLOCK and the default state (see getDefault).
    */
 
   "image": {
     getDefault: function () {
       return Services.prefs.getIntPref("permissions.default.image") == 2 ?
@@ -157,17 +162,18 @@ var gPermissionObject = {
       if (Services.prefs.getIntPref("network.cookie.lifetimePolicy") == 2)
         return SitePermissions.SESSION;
 
       return SitePermissions.ALLOW;
     }
   },
 
   "desktop-notification": {
-    exactHostMatch: true
+    exactHostMatch: true,
+    labelID: "desktop-notification2",
   },
 
   "camera": {},
   "microphone": {},
 
   "popup": {
     getDefault: function () {
       return Services.prefs.getBoolPref("dom.disable_open_during_load") ?