Bug 502307 - Closing multiple tabs in the last browser window with Private Browsing enabled yields no warning regardless of preference setting; r=enndeakin

This commit is contained in:
Ehsan Akhgari 2009-07-17 23:08:22 +04:30
Родитель 11c1f0c73f
Коммит 525c20751f
1 изменённых файлов: 10 добавлений и 1 удалений

Просмотреть файл

@ -13,10 +13,19 @@ function closeWindow(aClose, aPromptFunction)
break;
}
var inPrivateBrowsing = false;
try {
var pbSvc = Components.classes["@mozilla.org/privatebrowsing;1"]
.getService(Components.interfaces.nsIPrivateBrowsingService);
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)
else if (windowCount != 1 || inPrivateBrowsing)
#endif
if (typeof(aPromptFunction) == "function" && !aPromptFunction())
return false;