Backed out changeset 405a715a4d81 from bug 502307 due to test failures

This commit is contained in:
Dave Townsend 2009-08-19 10:38:09 +01:00
parent 3b96626648
commit 20e6c6acda
2 changed files with 11 additions and 18 deletions

View File

@ -5719,17 +5719,13 @@ function warnAboutClosingWindow() {
os.notifyObservers(null, "browser-lastwindow-close-granted", null);
#ifdef XP_MACOSX
// On OS X, always warn about closing multiple tabs, as closing the
// last window won't quit the application.
// OS X doesn't quit the application when the last window is closed, but keeps
// the session alive. Hence don't prompt users to save tabs, but warn about
// closing multiple tabs.
return gBrowser.warnAboutClosingTabs(true);
#else
// If we're inside auto-started private browsing mode, always warn
// about closing multiple tabs (bug 502307).
if (gPrivateBrowsingUI.privateBrowsingEnabled &&
gPrivateBrowsingUI.autoStarted)
#endif
return gBrowser.warnAboutClosingTabs(true);
return true;
#endif
}
var MailIntegration = {
@ -7042,10 +7038,6 @@ let gPrivateBrowsingUI = {
get privateBrowsingEnabled PBUI_get_privateBrowsingEnabled() {
return this._privateBrowsingService.privateBrowsingEnabled;
},
get autoStarted PBUI_get_autoStarted() {
return this._privateBrowsingService.autoStarted;
}
};

View File

@ -13,18 +13,19 @@ function closeWindow(aClose, aPromptFunction)
break;
}
var showPromptOverride = false;
if ("@mozilla.org/privatebrowsing;1" in Components.classes) {
var inPrivateBrowsing = false;
try {
var pbSvc = Components.classes["@mozilla.org/privatebrowsing;1"]
.getService(Components.interfaces.nsIPrivateBrowsingService);
showPromptOverride = pbSvc.privateBrowsingEnabled &&
pbSvc.autoStarted;
inPrivateBrowsing = pbSvc.privateBrowsingEnabled;
} catch(e) {
// safe to ignore
}
// If we're down to the last window and someone tries to shut down, check to make sure we can!
if (windowCount == 1 && !canQuitApplication())
return false;
else if (windowCount != 1 || showPromptOverride)
else if (windowCount != 1 || inPrivateBrowsing)
#endif
if (typeof(aPromptFunction) == "function" && !aPromptFunction())
return false;