Backed out changeset 61e57c281b9a (bug 844561) CLOSED TREE
This commit is contained in:
@@ -6409,20 +6409,20 @@ function warnAboutClosingWindow() {
|
||||
// Figure out if there's at least one other browser window around.
|
||||
let e = Services.wm.getEnumerator("navigator:browser");
|
||||
let otherPBWindowExists = false;
|
||||
let nonPopupPresent = false;
|
||||
let warnAboutClosingTabs = false;
|
||||
while (e.hasMoreElements()) {
|
||||
let win = e.getNext();
|
||||
if (win != window) {
|
||||
if (isPBWindow && PrivateBrowsingUtils.isWindowPrivate(win))
|
||||
otherPBWindowExists = true;
|
||||
if (win.toolbar.visible)
|
||||
nonPopupPresent = true;
|
||||
warnAboutClosingTabs = true;
|
||||
// If the current window is not in private browsing mode we don't need to
|
||||
// look for other pb windows, we can leave the loop when finding the
|
||||
// first non-popup window. If however the current window is in private
|
||||
// browsing mode then we need at least one other pb and one non-popup
|
||||
// window to break out early.
|
||||
if ((!isPBWindow || otherPBWindowExists) && nonPopupPresent)
|
||||
if ((!isPBWindow || otherPBWindowExists) && warnAboutClosingTabs)
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -6437,8 +6437,7 @@ function warnAboutClosingWindow() {
|
||||
if (exitingCanceled.data)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!isPBWindow && nonPopupPresent)
|
||||
if (warnAboutClosingTabs)
|
||||
return gBrowser.warnAboutClosingTabs(true);
|
||||
|
||||
let os = Services.obs;
|
||||
|
||||
@@ -315,7 +315,6 @@ _BROWSER_FILES = \
|
||||
feed_tab.html \
|
||||
browser_pluginCrashCommentAndURL.js \
|
||||
pluginCrashCommentAndURL.html \
|
||||
browser_private_no_prompt.js \
|
||||
$(NULL)
|
||||
|
||||
ifneq (cocoa,$(MOZ_WIDGET_TOOLKIT))
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
var privateWin = OpenBrowserWindow({private: true});
|
||||
privateWin.addEventListener("load", function onload() {
|
||||
privateWin.removeEventListener("load", onload, false);
|
||||
|
||||
privateWin.BrowserOpenTab();
|
||||
privateWin.BrowserTryToCloseWindow();
|
||||
ok(true, "didn't prompt");
|
||||
finish();
|
||||
}, false);
|
||||
}
|
||||
Reference in New Issue
Block a user