Bug 859326 - Hide the New Window Mac OS X dock menu item in permanent Private Browsing mode; r=jdm
authorEhsan Akhgari <ehsan@mozilla.com>
Mon, 08 Apr 2013 11:30:50 -0400
changeset 128183 faf3b775851c726ce3c06bdfcfe14de50c330d59
parent 128182 5943881c5298826d687a75f0a7ee0f624465b7b3
child 128184 82deda121d716b5de2b49a1e521ee5cf5a80fb47
push id26183
push usereakhgari@mozilla.com
push dateTue, 09 Apr 2013 16:52:05 +0000
treeherdermozilla-inbound@faf3b775851c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjdm
bugs859326
milestone23.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 859326 - Hide the New Window Mac OS X dock menu item in permanent Private Browsing mode; r=jdm
browser/base/content/browser.js
browser/base/content/macBrowserOverlay.xul
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -1802,16 +1802,20 @@ var gBrowserInit = {
         }
         catch (e) {
         }
       }
     }
 
     SocialUI.nonBrowserWindowInit();
 
+    if (PrivateBrowsingUtils.permanentPrivateBrowsing) {
+      document.getElementById("macDockMenuNewWindow").hidden = true;
+    }
+
     this._delayedStartupTimeoutId = setTimeout(this.nonBrowserWindowDelayedStartup.bind(this), 0);
   },
 
   nonBrowserWindowDelayedStartup: function() {
     this._delayedStartupTimeoutId = null;
 
     // initialise the offline listener
     BrowserOffline.init();
--- a/browser/base/content/macBrowserOverlay.xul
+++ b/browser/base/content/macBrowserOverlay.xul
@@ -50,14 +50,15 @@
 # hiddenWindow.xul.
 #include browser-menubar.inc
 
 <!-- Dock menu -->
 <popupset>
   <menupopup id="menu_mac_dockmenu">
     <!-- The command cannot be cmd_newNavigator because we need to activate
          the application. -->
-    <menuitem label="&newNavigatorCmd.label;" oncommand="OpenBrowserWindowFromDockMenu();" />
+    <menuitem label="&newNavigatorCmd.label;" oncommand="OpenBrowserWindowFromDockMenu();"
+              id="macDockMenuNewWindow" />
     <menuitem label="&newPrivateWindow.label;" oncommand="OpenBrowserWindowFromDockMenu({private: true});" />
   </menupopup>
 </popupset>
 
 </overlay>