Bug 841616 Open Location should have Private Window option r=IanN,Ratty
authorNeil Rashbrook <neil@parkwaycc.co.uk>
Tue, 19 Feb 2013 00:18:33 +0000
changeset 12016 94c2be83ba41413797263117c4c85661fee54a6a
parent 12015 447443b87c8ef443225f111d5c47037bc503f727
child 12017 a817772d995d4f0d84c7ae9f84054b4d1e16d753
push id8913
push userneil@parkwaycc.co.uk
push dateTue, 19 Feb 2013 00:18:42 +0000
treeherdercomm-central@94c2be83ba41 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersIanN, Ratty
bugs841616
Bug 841616 Open Location should have Private Window option r=IanN,Ratty
editor/ui/composer/content/ComposerCommands.js
suite/browser/navigator.js
suite/common/openLocation.js
suite/common/openLocation.xul
suite/locales/en-US/chrome/common/openLocation.dtd
--- a/editor/ui/composer/content/ComposerCommands.js
+++ b/editor/ui/composer/content/ComposerCommands.js
@@ -2091,16 +2091,19 @@ var nsOpenRemoteCommand =
       case "2": // edit
         editPage(params.url);
         break;
       case "3": // new tab
         win.focus();
         var browser = win.getBrowser();
         browser.selectedTab = browser.addTab(params.url, {allowThirdPartyFixup: true});
         break;
+      case "4": // private
+        openNewPrivateWith(params.url);
+        break;
       default:
         break;
     }
   }
 };
 
 //-----------------------------------------------------------------------------------
 var nsPreviewCommand =
--- a/suite/browser/navigator.js
+++ b/suite/browser/navigator.js
@@ -1297,16 +1297,19 @@ function BrowserOpenWindow()
                  postData.value, true);
       break;
     case "2": // edit
       editPage(url);
       break;
     case "3": // new tab
       gBrowser.selectedTab = gBrowser.addTab(url, {allowThirdPartyFixup: true, postData: postData.value});
       break;
+    case "4": // private
+      openNewPrivateWith(params.url);
+      break;
   }
 }
 
 function BrowserOpenTab()
 {
   if (!gInPrintPreviewMode) {
     var uriToLoad;
     var tabPref = GetIntPref("browser.tabs.loadOnNewTab",0);
--- a/suite/common/openLocation.js
+++ b/suite/common/openLocation.js
@@ -65,18 +65,21 @@ function doEnabling()
 {
   gAcceptButton.disabled = !gInput.value;
 }
 
 function accept()
 {
   var params = window.arguments[0];
   params.url = gInput.value;
+  params.action = gOpenAppList.value;
+  if (params.action == "4")
+    return; // private, don't set any preferences
+
   if (gAction != "4") { // open web page
-    params.action = gOpenAppList.value;
     // If there were no browser windows open and not set to open in composer
     // then set to open in a new window.
     if (gAction == "-1" && params.action != "2")
       params.action = "1";
 
     // If open web page from navigator window, save last window choice.
     if (gAction == "0")
       Services.prefs.setIntPref("general.open_location.last_window_choice",
--- a/suite/common/openLocation.xul
+++ b/suite/common/openLocation.xul
@@ -56,16 +56,17 @@
         <menulist id="openAppList">
           <menupopup>
             <menuitem value="0"
                       id="currentTab"
                       label="&currentTab.label;"
                       selected="true"/>
             <menuitem value="3" id="newTab" label="&newTab.label;"/>
             <menuitem value="1" id="newWindow" label="&newWindow.label;"/>
+            <menuitem value="4" id="newPrivate" label="&newPrivate.label;"/>
             <menuseparator/>
             <menuitem value="2" id="editWindow" label="&editNewWindow.label;"/>
           </menupopup>
         </menulist>
         <spacer flex="1"/>
       </hbox>
     </vbox>
   </hbox> 
--- a/suite/locales/en-US/chrome/common/openLocation.dtd
+++ b/suite/locales/en-US/chrome/common/openLocation.dtd
@@ -6,16 +6,17 @@
 
 <!ENTITY enter.label "Enter the web location (URL), or specify the local file you would like to open:">
 <!-- LOCALIZATION NOTE (enter.accesskey): should be present in both enter.label
      as defined above and attachEnterLabel as defined in
      openLocation.properties -->
 <!ENTITY enter.accesskey "E">
 <!ENTITY chooseFile.label "Choose Fileā€¦">
 <!ENTITY chooseFile.accesskey "C">
+<!ENTITY newPrivate.label "New private window">
 <!ENTITY newWindow.label "New browser window">
 <!ENTITY newTab.label "New browser tab">
 <!ENTITY currentTab.label "Current browser tab">
 <!ENTITY editNewWindow.label "New Composer window">
 <!ENTITY open.label "Open">
 <!ENTITY caption.label "Open Web Location">
 <!ENTITY openWhere.label "Open in:">
 <!ENTITY openWhere.accesskey "O">