Bug 1142066: add strings for screen sharing type Browser, aka tab-sharing for the WebRTC UI indicators. r=florian
authorMike de Boer <mdeboer@mozilla.com>
Thu, 12 Mar 2015 17:02:28 +0100
changeset 250119 3e784015e7aaa154aeae0c3f8d746ea298caf77b
parent 250118 912179142d7efdb81dd3527c0eeb0b0ba9806b49
child 250120 a79fada9fcbf148eb073d8a0d2c34c91d3e5a1b8
push id1010
push usermleibovic@mozilla.com
push dateThu, 12 Mar 2015 18:26:20 +0000
reviewersflorian
bugs1142066
milestone39.0a1
Bug 1142066: add strings for screen sharing type Browser, aka tab-sharing for the WebRTC UI indicators. r=florian
browser/base/content/webrtcIndicator.js
browser/locales/en-US/chrome/browser/browser.properties
browser/locales/en-US/chrome/browser/webrtcIndicator.properties
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/locales/en-US/chrome/browser/browser.properties
+++ b/browser/locales/en-US/chrome/browser/browser.properties
@@ -555,54 +555,63 @@ getUserMedia.denyRequest.accesskey = D
 getUserMedia.never.label = Never Share
 getUserMedia.never.accesskey = N
 getUserMedia.sharingCamera.message2 = You are currently sharing your camera with this page.
 getUserMedia.sharingMicrophone.message2 = You are currently sharing your microphone with this page.
 getUserMedia.sharingCameraAndMicrophone.message2 = You are currently sharing your camera and microphone with this page.
 getUserMedia.sharingApplication.message = You are currently sharing an application with this page.
 getUserMedia.sharingScreen.message = You are currently sharing your screen with this page.
 getUserMedia.sharingWindow.message = You are currently sharing a window with this page.
+getUserMedia.sharingBrowser.message = You are currently sharing a tab with this page.
 getUserMedia.continueSharing.label = Continue Sharing
 getUserMedia.continueSharing.accesskey = C
 getUserMedia.stopSharing.label = Stop Sharing
 getUserMedia.stopSharing.accesskey = S
 
 getUserMedia.sharingMenu.label = Tabs sharing devices
 getUserMedia.sharingMenu.accesskey = d
 # LOCALIZATION NOTE (getUserMedia.sharingMenuCamera
 #                    getUserMedia.sharingMenuMicrophone,
 #                    getUserMedia.sharingMenuApplication,
 #                    getUserMedia.sharingMenuScreen,
 #                    getUserMedia.sharingMenuWindow,
+#                    getUserMedia.sharingMenuBrowser,
 #                    getUserMedia.sharingMenuCameraMicrophone,
 #                    getUserMedia.sharingMenuCameraMicrophoneApplication,
 #                    getUserMedia.sharingMenuCameraMicrophoneScreen,
 #                    getUserMedia.sharingMenuCameraMicrophoneWindow,
+#                    getUserMedia.sharingMenuCameraMicrophoneBrowser,
 #                    getUserMedia.sharingMenuCameraApplication,
 #                    getUserMedia.sharingMenuCameraScreen,
 #                    getUserMedia.sharingMenuCameraWindow,
+#                    getUserMedia.sharingMenuCameraBrowser,
 #                    getUserMedia.sharingMenuMicrophoneApplication,
 #                    getUserMedia.sharingMenuMicrophoneScreen,
-#                    getUserMedia.sharingMenuMicrophoneWindow):
+#                    getUserMedia.sharingMenuMicrophoneWindow,
+#                    getUserMedia.sharingMenuMicrophoneBrowser):
 # %S is the website origin (e.g. www.mozilla.org)
 getUserMedia.sharingMenuCamera = %S (camera)
 getUserMedia.sharingMenuMicrophone = %S (microphone)
 getUserMedia.sharingMenuApplication = %S (application)
 getUserMedia.sharingMenuScreen = %S (screen)
 getUserMedia.sharingMenuWindow = %S (window)
+getUserMedia.sharingMenuBrowser = %S (tab)
 getUserMedia.sharingMenuCameraMicrophone = %S (camera and microphone)
 getUserMedia.sharingMenuCameraMicrophoneApplication = %S (camera, microphone and application)
 getUserMedia.sharingMenuCameraMicrophoneScreen = %S (camera, microphone and screen)
 getUserMedia.sharingMenuCameraMicrophoneWindow = %S (camera, microphone and window)
+getUserMedia.sharingMenuCameraMicrophoneBrowser = %S (camera, microphone and tab)
 getUserMedia.sharingMenuCameraApplication = %S (camera and application)
 getUserMedia.sharingMenuCameraScreen = %S (camera and screen)
 getUserMedia.sharingMenuCameraWindow = %S (camera and window)
+getUserMedia.sharingMenuCameraBrowser = %S (camera and tab)
 getUserMedia.sharingMenuMicrophoneApplication = %S (microphone and application)
 getUserMedia.sharingMenuMicrophoneScreen = %S (microphone and screen)
 getUserMedia.sharingMenuMicrophoneWindow = %S (microphone and window)
+getUserMedia.sharingMenuMicrophoneBrowser = %S (microphone and tab)
 # LOCALIZATION NOTE(getUserMedia.sharingMenuUnknownHost): this is used for the website
 # origin for the sharing menu if no readable origin could be deduced from the URL.
 getUserMedia.sharingMenuUnknownHost = Unknown origin
 
 # LOCALIZATION NOTE(emeNotifications.drmContentPlaying.message2): %S is brandShortName.
 emeNotifications.drmContentPlaying.message2 = Some audio or video on this site uses DRM software, which may limit what %S can let you do with it.
 emeNotifications.drmContentPlaying.button.label = Configureā€¦
 emeNotifications.drmContentPlaying.button.accesskey = C
--- a/browser/locales/en-US/chrome/browser/webrtcIndicator.properties
+++ b/browser/locales/en-US/chrome/browser/webrtcIndicator.properties
@@ -10,28 +10,30 @@
 webrtcIndicator.windowtitle = %S - Sharing Indicator
 
 webrtcIndicator.sharingCameraAndMicrophone.tooltip = Your camera and microphone are being shared. Click to control sharing.
 webrtcIndicator.sharingCamera.tooltip              = Your camera is being shared. Click to control sharing.
 webrtcIndicator.sharingMicrophone.tooltip          = Your microphone is being shared. Click to control sharing.
 webrtcIndicator.sharingApplication.tooltip = An application is being shared. Click to control sharing.
 webrtcIndicator.sharingScreen.tooltip = Your screen is being shared. Click to control sharing.
 webrtcIndicator.sharingWindow.tooltip = A window is being shared. Click to control sharing.
+webrtcIndicator.sharingBrowser.tooltip = A tab is being shared. Click to control sharing.
 
 
 # LOCALIZATION NOTE : The following strings are only used on Mac for
 # menus attached to icons near the clock on the mac menubar.
 
 # LOCALIZATION NOTE (webrtcIndicator.sharing*With.menuitem):
 # %S is the title of the tab using the share.
 webrtcIndicator.sharingCameraWith.menuitem = Sharing Camera with "%S"
 webrtcIndicator.sharingMicrophoneWith.menuitem = Sharing Microphone with "%S"
 webrtcIndicator.sharingApplicationWith.menuitem = Sharing an Application with "%S"
 webrtcIndicator.sharingScreenWith.menuitem = Sharing Screen with "%S"
 webrtcIndicator.sharingWindowWith.menuitem = Sharing a Window with "%S"
+webrtcIndicator.sharingBrowserWith.menuitem = Sharing a Tab with "%S"
 webrtcIndicator.controlSharing.menuitem = Control Sharing
 # LOCALIZATION NOTE (webrtcIndicator.sharingCameraWithNTabs.menuitem):
 # Semicolon-separated list of plural forms. See:
 # http://developer.mozilla.org/en/docs/Localization_and_Plurals
 webrtcIndicator.sharingCameraWithNTabs.menuitem = Sharing Camera with #1 tab;Sharing Camera with #1 tabs
 # LOCALIZATION NOTE (webrtcIndicator.sharingMicrophoneWithNTabs.menuitem):
 # Semicolon-separated list of plural forms. See:
 # http://developer.mozilla.org/en/docs/Localization_and_Plurals
@@ -43,11 +45,15 @@ webrtcIndicator.sharingApplicationWithNT
 # LOCALIZATION NOTE (webrtcIndicator.sharingScreenWithNTabs.menuitem):
 # Semicolon-separated list of plural forms. See:
 # http://developer.mozilla.org/en/docs/Localization_and_Plurals
 webrtcIndicator.sharingScreenWithNTabs.menuitem = Sharing Screen with #1 tab;Sharing Screen with #1 tabs
 # LOCALIZATION NOTE (webrtcIndicator.sharingWindowWithNTabs.menuitem):
 # Semicolon-separated list of plural forms. See:
 # http://developer.mozilla.org/en/docs/Localization_and_Plurals
 webrtcIndicator.sharingWindowWithNTabs.menuitem = Sharing a Window with #1 tab;Sharing Windows with #1 tabs
+# LOCALIZATION NOTE (webrtcIndicator.sharingBrowserWithNTabs.menuitem):
+# Semicolon-separated list of plural forms. See:
+# http://developer.mozilla.org/en/docs/Localization_and_Plurals
+webrtcIndicator.sharingBrowserWithNTabs.menuitem = Sharing a Tab with #1 tab;Sharing Tabs with #1 tabs
 # LOCALIZATION NOTE (webrtcIndicator.controlSharingOn.menuitem):
 # %S is the title of the tab using the share.
 webrtcIndicator.controlSharingOn.menuitem = Control Sharing on "%S"
--- a/browser/modules/webrtcUI.jsm
+++ b/browser/modules/webrtcUI.jsm
@@ -484,39 +484,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"));
@@ -525,17 +522,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");
@@ -827,17 +824,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) {