diff --git a/mozilla/build/mac/build_scripts/MozillaBuildList.pm b/mozilla/build/mac/build_scripts/MozillaBuildList.pm index 595e929a514..e7cd68fd50b 100644 --- a/mozilla/build/mac/build_scripts/MozillaBuildList.pm +++ b/mozilla/build/mac/build_scripts/MozillaBuildList.pm @@ -1761,6 +1761,7 @@ sub BuildXPAppProjects() BuildOneProject(":mozilla:xpfe:components:regviewer:RegViewer.mcp", "RegViewer$D.$S", 1, $main::ALIAS_SYM_FILES, 1); BuildOneProject(":mozilla:xpfe:components:shistory:macbuild:shistory.mcp", "shistory$D.$S", 1, $main::ALIAS_SYM_FILES, 1); BuildOneProject(":mozilla:xpfe:components:macbuild:appcomps.mcp", "appcomps$D.$S", 1, $main::ALIAS_SYM_FILES, 1); + InstallFromManifest(":mozilla:xpfe:appshell:src:MANIFEST_COMPONENTS", "${dist_dir}Components:"); # Applications BuildOneProject(":mozilla:xpfe:appshell:macbuild:AppShell.mcp", "AppShell$D.$S", 1, $main::ALIAS_SYM_FILES, 1); diff --git a/mozilla/xpfe/appshell/macbuild/appshellIDL.mcp b/mozilla/xpfe/appshell/macbuild/appshellIDL.mcp index 3745d8b28fa..e5da9815bd1 100644 Binary files a/mozilla/xpfe/appshell/macbuild/appshellIDL.mcp and b/mozilla/xpfe/appshell/macbuild/appshellIDL.mcp differ diff --git a/mozilla/xpfe/appshell/src/nsCommandLineServiceMac.cpp b/mozilla/xpfe/appshell/src/nsCommandLineServiceMac.cpp index dc47c908e48..14dc8b8e7b0 100644 --- a/mozilla/xpfe/appshell/src/nsCommandLineServiceMac.cpp +++ b/mozilla/xpfe/appshell/src/nsCommandLineServiceMac.cpp @@ -60,6 +60,7 @@ static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID); #include "nsIWindowWatcher.h" #include "jsapi.h" #include "nsReadableUtils.h" +#include "nsICloseAllWindows.h" #include "nsAEEventHandling.h" @@ -339,6 +340,17 @@ OSErr nsMacCommandLine::Quit(TAskSave askSave) //---------------------------------------------------------------------------------------- { nsresult rv; + + nsCOMPtr closer = + do_CreateInstance("@mozilla.org/appshell/closeallwindows;1", &rv); + if (NS_FAILED(rv)) + return errAEEventNotHandled; + + PRBool doQuit; + rv = closer->CloseAll(askSave != eSaveNo, &doQuit); + if (NS_FAILED(rv) || !doQuit) + return errAEEventNotHandled; + nsCOMPtr appShellService = do_GetService(kAppShellServiceCID, &rv); if (NS_FAILED(rv)) diff --git a/mozilla/xpfe/components/startup/src/nsCommandLineServiceMac.cpp b/mozilla/xpfe/components/startup/src/nsCommandLineServiceMac.cpp index dc47c908e48..14dc8b8e7b0 100644 --- a/mozilla/xpfe/components/startup/src/nsCommandLineServiceMac.cpp +++ b/mozilla/xpfe/components/startup/src/nsCommandLineServiceMac.cpp @@ -60,6 +60,7 @@ static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID); #include "nsIWindowWatcher.h" #include "jsapi.h" #include "nsReadableUtils.h" +#include "nsICloseAllWindows.h" #include "nsAEEventHandling.h" @@ -339,6 +340,17 @@ OSErr nsMacCommandLine::Quit(TAskSave askSave) //---------------------------------------------------------------------------------------- { nsresult rv; + + nsCOMPtr closer = + do_CreateInstance("@mozilla.org/appshell/closeallwindows;1", &rv); + if (NS_FAILED(rv)) + return errAEEventNotHandled; + + PRBool doQuit; + rv = closer->CloseAll(askSave != eSaveNo, &doQuit); + if (NS_FAILED(rv) || !doQuit) + return errAEEventNotHandled; + nsCOMPtr appShellService = do_GetService(kAppShellServiceCID, &rv); if (NS_FAILED(rv)) diff --git a/mozilla/xpfe/global/resources/content/globalOverlay.js b/mozilla/xpfe/global/resources/content/globalOverlay.js index 061f902b3d4..f9de52e4eff 100644 --- a/mozilla/xpfe/global/resources/content/globalOverlay.js +++ b/mozilla/xpfe/global/resources/content/globalOverlay.js @@ -29,10 +29,10 @@ function goQuitApplication() while ( enumerator.hasMoreElements() ) { - var windowToClose = enumerator.getNext(); - var domWindow = windowManagerInterface.convertISupportsToDOMWindow( windowToClose ); - if (!("tryToClose" in domWindow) || domWindow.tryToClose()) - domWindow.close(); + var domWindow = enumerator.getNext(); + if (("tryToClose" in domWindow) && !domWindow.tryToClose()) + return false; + domWindow.close(); }; if (!nativeAppSupport || !nativeAppSupport.isServerMode) appShell.quit(); diff --git a/mozilla/xpinstall/packager/packages-mac b/mozilla/xpinstall/packager/packages-mac index 3611944e735..9edfdc8eb7b 100644 --- a/mozilla/xpinstall/packager/packages-mac +++ b/mozilla/xpinstall/packager/packages-mac @@ -184,6 +184,7 @@ viewer:Components:xmlextras.shlb viewer:Components:nsHelperAppDlg.js viewer:Components:transformiix.xpt viewer:Components:transformiix.shlb +viewer:Components:nsCloseAllWindows.js viewer:Components:gfx2.shlb viewer:Components:libimg2.shlb