Bug 1142066: add strings for screen sharing type Browser, aka tab-sharing for the WebRTC UI indicators. r=florian, a=gavin, l10n=gavin
authorMike de Boer <mdeboer@mozilla.com>
Thu, 12 Mar 2015 17:02:28 +0100
changeset 248126 9b59f3a2743da31da70342679e301e9867f01074
parent 248125 0b78e34a3347962cb388c4198154a282ec03b5ec
child 248127 d98504aa80c2f2847ca53e02c477c10dbb7214fd
push id7762
push usermdeboer@mozilla.com
push dateMon, 16 Mar 2015 15:07:09 +0000
treeherdermozilla-aurora@9b59f3a2743d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersflorian, gavin
bugs1142066
milestone38.0a2
Bug 1142066: add strings for screen sharing type Browser, aka tab-sharing for the WebRTC UI indicators. r=florian, a=gavin, l10n=gavin
browser/base/content/webrtcIndicator.js
browser/modules/webrtcUI.jsm
--- a/browser/base/content/webrtcIndicator.js
+++ b/browser/base/content/webrtcIndicator.js
@@ -52,21 +52,18 @@ function updateIndicatorState() {
   }
   else {
     audioVideoButton.removeAttribute("tooltiptext");
   }
 
   // Screen sharing button tooltip.
   let screenShareButton = document.getElementById("screenShareButton");
   if (webrtcUI.showScreenSharingIndicator) {
-    // This can be removed once strings are added for type 'Browser' in bug 1142066.
-    let typeForL10n = webrtcUI.showScreenSharingIndicator;
-    if (typeForL10n == "Browser")
-      typeForL10n = "Window";
-    let stringId = "webrtcIndicator.sharing" + typeForL10n + ".tooltip";
+    let stringId = "webrtcIndicator.sharing" +
+      webrtcUI.showScreenSharingIndicator + ".tooltip";
     screenShareButton.setAttribute("tooltiptext",
                                     gStringBundle.GetStringFromName(stringId));
   }
   else {
     screenShareButton.removeAttribute("tooltiptext");
   }
 
   // Resize and ensure the window position is correct
--- a/browser/modules/webrtcUI.jsm
+++ b/browser/modules/webrtcUI.jsm
@@ -477,39 +477,36 @@ function getGlobalIndicator() {
         type = "Devices";
       else if (type == "Window" || type == "Application" || type == "Browser")
         type = "Screen";
       webrtcUI.showSharingDoorhanger(aEvent.target.stream, type);
     },
 
     _popupShowing: function(aEvent) {
       let type = this.getAttribute("type");
-      // This can be removed once strings are added for type 'Browser' in bug 1142066.
-      let typeForL10n = type;
       let activeStreams;
       if (type == "Camera") {
         activeStreams = webrtcUI.getActiveStreams(true, false, false);
       }
       else if (type == "Microphone") {
         activeStreams = webrtcUI.getActiveStreams(false, true, false);
       }
       else if (type == "Screen") {
         activeStreams = webrtcUI.getActiveStreams(false, false, true);
         type = webrtcUI.showScreenSharingIndicator;
-        typeForL10n = type == "Browser" ? "Window" : type;
       }
 
       let bundle =
         Services.strings.createBundle("chrome://browser/locale/webrtcIndicator.properties");
 
       if (activeStreams.length == 1) {
         let stream = activeStreams[0];
 
         let menuitem = this.ownerDocument.createElement("menuitem");
-        let labelId = "webrtcIndicator.sharing" + typeForL10n + "With.menuitem";
+        let labelId = "webrtcIndicator.sharing" + type + "With.menuitem";
         let label = stream.browser.contentTitle || stream.uri;
         menuitem.setAttribute("label", bundle.formatStringFromName(labelId, [label], 1));
         menuitem.setAttribute("disabled", "true");
         this.appendChild(menuitem);
 
         menuitem = this.ownerDocument.createElement("menuitem");
         menuitem.setAttribute("label",
                               bundle.GetStringFromName("webrtcIndicator.controlSharing.menuitem"));
@@ -518,17 +515,17 @@ function getGlobalIndicator() {
         menuitem.addEventListener("command", indicator._command);
 
         this.appendChild(menuitem);
         return true;
       }
 
       // We show a different menu when there are several active streams.
       let menuitem = this.ownerDocument.createElement("menuitem");
-      let labelId = "webrtcIndicator.sharing" + typeForL10n + "WithNTabs.menuitem";
+      let labelId = "webrtcIndicator.sharing" + type + "WithNTabs.menuitem";
       let count = activeStreams.length;
       let label = PluralForm.get(count, bundle.GetStringFromName(labelId)).replace("#1", count);
       menuitem.setAttribute("label", label);
       menuitem.setAttribute("disabled", "true");
       this.appendChild(menuitem);
 
       for (let stream of activeStreams) {
         let item = this.ownerDocument.createElement("menuitem");
@@ -820,17 +817,17 @@ function updateBrowserSpecificIndicator(
     }
   }];
 
   // Ending browser-sharing from the gUM doorhanger is not supported at the moment.
   // See bug 1142091.
   if (isBrowserSharing)
     mainAction = secondaryActions = null;
   // If we are sharing both a window and the screen, we show 'Screen'.
-  let stringId = "getUserMedia.sharing" + (isBrowserSharing ? "Window" : aState.screen);
+  let stringId = "getUserMedia.sharing" + aState.screen;
   screenSharingNotif =
     chromeWin.PopupNotifications.show(aBrowser, "webRTC-sharingScreen",
                                       stringBundle.getString(stringId + ".message"),
                                       "webRTC-sharingScreen-notification-icon",
                                       mainAction, secondaryActions, options);
 }
 
 function removeBrowserNotification(aBrowser, aNotificationId) {