diff options
author | Matt A. Tobin <email@mattatobin.com> | 2020-02-01 23:45:36 -0500 |
---|---|---|
committer | wolfbeast <mcwerewolf@wolfbeast.com> | 2020-04-14 12:26:11 +0200 |
commit | 4acc0d58cb0fa989d609972493be363c105f2594 (patch) | |
tree | b0c4dfd608561041b83da74a1eba5739ab3931ec /toolkit/content/globalOverlay.js | |
parent | a1c9dd468daa6d729c9d11416fb8a5c2dceb2c88 (diff) | |
download | UXP-4acc0d58cb0fa989d609972493be363c105f2594.tar UXP-4acc0d58cb0fa989d609972493be363c105f2594.tar.gz UXP-4acc0d58cb0fa989d609972493be363c105f2594.tar.lz UXP-4acc0d58cb0fa989d609972493be363c105f2594.tar.xz UXP-4acc0d58cb0fa989d609972493be363c105f2594.zip |
Issue #65 - Remove AppConstants from toolkit/content
Diffstat (limited to 'toolkit/content/globalOverlay.js')
-rw-r--r-- | toolkit/content/globalOverlay.js | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/toolkit/content/globalOverlay.js b/toolkit/content/globalOverlay.js index 1df3d65fc..d8467f0a1 100644 --- a/toolkit/content/globalOverlay.js +++ b/toolkit/content/globalOverlay.js @@ -4,32 +4,32 @@ function closeWindow(aClose, aPromptFunction) { - let { AppConstants } = Components.utils.import("resource://gre/modules/AppConstants.jsm"); - +#ifdef XP_MACOSX // Closing the last window doesn't quit the application on OS X. - if (AppConstants.platform != "macosx") { - var windowCount = 0; - var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"] - .getService(Components.interfaces.nsIWindowMediator); - var e = wm.getEnumerator(null); - - while (e.hasMoreElements()) { - var w = e.getNext(); - if (w.closed) { - continue; - } - if (++windowCount == 2) - break; + if (typeof(aPromptFunction) == "function" && !aPromptFunction()) { + return false; + } +#else + var windowCount = 0; + var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"] + .getService(Components.interfaces.nsIWindowMediator); + var e = wm.getEnumerator(null); + + while (e.hasMoreElements()) { + var w = e.getNext(); + if (w.closed) { + continue; } + if (++windowCount == 2) + break; + } - // If we're down to the last window and someone tries to shut down, check to make sure we can! - if (windowCount == 1 && !canQuitApplication("lastwindow")) - return false; - if (windowCount != 1 && typeof(aPromptFunction) == "function" && !aPromptFunction()) - return false; - } else if (typeof(aPromptFunction) == "function" && !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("lastwindow")) return false; - } + if (windowCount != 1 && typeof(aPromptFunction) == "function" && !aPromptFunction()) + return false; +#endif if (aClose) { window.close(); |