From 113e4193e40cc13b3e94c4df76a8209485db330c Mon Sep 17 00:00:00 2001 From: "andybons@chromium.org" Date: Tue, 15 Dec 2009 19:25:51 +0000 Subject: Reattempt at r465143. The UI tests rely too heavily on the current behavior of closing the last window indicating exiting the entire app, so that is left alone for now with a TODO added. From the old description: Mac: Fixes bug where extension background hosts were being cleared when the last window was closed. It assumed that this meant the app was closing. Not the case with Mac apps. Added a mac-only notification APP_TERMINATED and use that to perform cleanup upon shutdown. TEST=More description in the bug, but basically just make sure that background views stick around even after you've closed the last window. BUG=28666 Review URL: http://codereview.chromium.org/502012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34580 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/browser_shutdown.cc | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'chrome/browser/browser_shutdown.cc') diff --git a/chrome/browser/browser_shutdown.cc b/chrome/browser/browser_shutdown.cc index 520ead7..3062dd7 100644 --- a/chrome/browser/browser_shutdown.cc +++ b/chrome/browser/browser_shutdown.cc @@ -24,6 +24,7 @@ #include "chrome/browser/renderer_host/render_view_host.h" #include "chrome/browser/renderer_host/render_widget_host.h" #include "chrome/common/chrome_paths.h" +#include "chrome/common/notification_service.h" #include "chrome/common/pref_names.h" #include "chrome/common/pref_service.h" #include "chrome/common/chrome_plugin_lib.h" @@ -90,6 +91,11 @@ FilePath GetShutdownMsPath() { #endif void Shutdown() { +#if defined(OS_MACOSX) + NotificationService::current()->Notify(NotificationType::APP_TERMINATING, + NotificationService::AllSources(), + NotificationService::NoDetails()); +#endif // Unload plugins. This needs to happen on the IO thread. ChromeThread::PostTask( ChromeThread::IO, FROM_HERE, -- cgit v1.1