Bug 806929: "Open in new private tab" for context-menus. [r=mfinkle]
☠☠ backed out by 6cb490697a27 ☠ ☠
authorSriram Ramasubramanian <sriram@mozilla.com>
Fri, 16 Nov 2012 13:20:33 -0800
changeset 114399 87d836ed8e2a3d0417e3cd6acd6574a66011119f
parent 114398 d8fb7a8bdae1b6f5110944eabff75634a85e2769
child 114400 90ef95622f5e7c13437334542ed8775082eb8e63
push id23917
push useremorley@mozilla.com
push dateThu, 29 Nov 2012 14:20:29 +0000
treeherdermozilla-central@c72d38e7a212 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle
bugs806929
milestone20.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 806929: "Open in new private tab" for context-menus. [r=mfinkle]
mobile/android/chrome/content/browser.js
mobile/android/locales/en-US/chrome/browser.properties
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -327,16 +327,27 @@ var BrowserApp = {
         let url = NativeWindow.contextmenus._getLinkURL(aTarget);
         BrowserApp.addTab(url, { selected: false, parentId: BrowserApp.selectedTab.id });
 
         let newtabStrings = Strings.browser.GetStringFromName("newtabpopup.opened");
         let label = PluralForm.get(1, newtabStrings).replace("#1", 1);
         NativeWindow.toast.show(label, "short");
       });
 
+    NativeWindow.contextmenus.add(Strings.browser.GetStringFromName("contextmenu.openInNewPrivateTab"),
+      NativeWindow.contextmenus.linkOpenableContext,
+      function(aTarget) {
+        let url = NativeWindow.contextmenus._getLinkURL(aTarget);
+        BrowserApp.addTab(url, { selected: false, parentId: BrowserApp.selectedTab.id, isPrivate: true });
+
+        let newtabStrings = Strings.browser.GetStringFromName("newprivatetabpopup.opened");
+        let label = PluralForm.get(1, newtabStrings).replace("#1", 1);
+        NativeWindow.toast.show(label, "short");
+      });
+
     NativeWindow.contextmenus.add(Strings.browser.GetStringFromName("contextmenu.copyLink"),
       NativeWindow.contextmenus.linkCopyableContext,
       function(aTarget) {
         let url = NativeWindow.contextmenus._getLinkURL(aTarget);
         NativeWindow.contextmenus._copyStringToDefaultClipboard(url);
       });
 
     NativeWindow.contextmenus.add(Strings.browser.GetStringFromName("contextmenu.copyEmailAddress"),
--- a/mobile/android/locales/en-US/chrome/browser.properties
+++ b/mobile/android/locales/en-US/chrome/browser.properties
@@ -103,20 +103,21 @@ desktopNotification.wantsTo=%S wants to 
 # LOCALIZATION NOTE (desktopNotification.useNotifications): Label that will be
 # used in site settings dialog.
 desktopNotification.useNotifications=Use Notifications
 # LOCALIZATION NOTE (desktopNotification.dontAskAgain): This label appears next to a
 # checkbox to indicate whether or not the user wants to make a permanent decision.
 desktopNotification.dontAskAgain=Don't ask again for this site
 
 # New Tab Popup
-# LOCALIZATION NOTE (newtabpopup): Semi-colon list of plural forms.
+# LOCALIZATION NOTE (newtabpopup, newprivatetabpopup): Semi-colon list of plural forms.
 # See: http://developer.mozilla.org/en/docs/Localization_and_Plurals
 # #1 number of tabs
 newtabpopup.opened=New tab opened;#1 new tabs opened
+newprivatetabpopup.opened=New private tab opened;#1 new private tabs opened
 
 # Error Console
 typeError=Error:
 typeWarning=Warning:
 
 # Offline web applications
 offlineApps.available2=%S wants to store data on your device for offline use.
 offlineApps.allow=Allow
@@ -205,16 +206,17 @@ intl.charsetmenu.browser.static=iso-8859
 # Application Menu
 appMenu.more=More
 
 # Text Selection
 selectionHelper.textCopied=Text copied to clipboard
 
 # Context menu
 contextmenu.openInNewTab=Open Link in New Tab
+contextmenu.openInNewPrivateTab=Open Link in New Private Tab
 contextmenu.share=Share
 contextmenu.copyLink=Copy Link
 contextmenu.shareLink=Share Link
 contextmenu.bookmarkLink=Bookmark Link
 contextmenu.copyEmailAddress=Copy Email Address
 contextmenu.shareEmailAddress=Share Email Address
 contextmenu.copyPhoneNumber=Copy Phone Number
 contextmenu.sharePhoneNumber=Share Phone Number