mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-04 04:58:00 +00:00
Bug 384907, Fix "Closing multiple tabs" warning suppression on last window on mac, r=mano
This commit is contained in:
parent
96595fe1ec
commit
5539ed3a74
@ -1,8 +1,8 @@
|
||||
function closeWindow(aClose, aPromptFunction)
|
||||
{
|
||||
var windowCount = 0;
|
||||
var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]
|
||||
.getService(Components.interfaces.nsIWindowMediator);
|
||||
var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]
|
||||
.getService(Components.interfaces.nsIWindowMediator);
|
||||
var e = wm.getEnumerator(null);
|
||||
|
||||
while (e.hasMoreElements()) {
|
||||
@ -16,9 +16,10 @@ function closeWindow(aClose, aPromptFunction)
|
||||
// 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)
|
||||
#endif
|
||||
if (windowCount != 1 && typeof(aPromptFunction) == "function" && !aPromptFunction())
|
||||
return false;
|
||||
if (typeof(aPromptFunction) == "function" && !aPromptFunction())
|
||||
return false;
|
||||
|
||||
if (aClose)
|
||||
window.close();
|
||||
|
Loading…
x
Reference in New Issue
Block a user