Bug 846762 Private windows should never prompt even if normal windows are open r=IanN
authorNeil Rashbrook <neil@parkwaycc.co.uk>
Wed, 06 Mar 2013 22:21:29 +0000
changeset 12088 70b7a4895fb3b8db33333b5d72c5d9e5f6dc5a30
parent 12087 9a11f1cc1da9f0b87861569a8bf9c69f9a362f5e
child 12089 d98a87973d357722387c0644a2ca041c3394994b
push id8972
push userneil@parkwaycc.co.uk
push dateWed, 06 Mar 2013 22:21:40 +0000
treeherdercomm-central@70b7a4895fb3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersIanN
bugs846762
Bug 846762 Private windows should never prompt even if normal windows are open r=IanN
suite/browser/navigator.js
--- a/suite/browser/navigator.js
+++ b/suite/browser/navigator.js
@@ -2336,29 +2336,29 @@ function maybeInitPopupContext()
 
 function WindowIsClosing()
 {
   var browser = getBrowser();
   var cn = browser.tabContainer.childNodes;
   var numtabs = cn.length;
   var reallyClose = true;
 
-  if (!/Mac/.test(navigator.platform) && isClosingLastBrowser()) {
+  if (!gPrivate && !/Mac/.test(navigator.platform) && isClosingLastBrowser()) {
     let closingCanceled = Components.classes["@mozilla.org/supports-PRBool;1"]
                                     .createInstance(Components.interfaces.nsISupportsPRBool);
     Services.obs.notifyObservers(closingCanceled, "browser-lastwindow-close-requested", null);
     if (closingCanceled.data)
       return false;
 
     Services.obs.notifyObservers(null, "browser-lastwindow-close-granted", null);
 
     return true;
   }
 
-  if (numtabs > 1) {
+  if (!gPrivate && numtabs > 1) {
     var shouldPrompt = Services.prefs.getBoolPref("browser.tabs.warnOnClose");
     if (shouldPrompt) {
       //default to true: if it were false, we wouldn't get this far
       var warnOnClose = {value:true};
 
        var buttonPressed = Services.prompt.confirmEx(window,
          gNavigatorBundle.getString('tabs.closeWarningTitle'),
          gNavigatorBundle.getFormattedString("tabs.closeWarning", [numtabs]),