Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(234)

Side by Side Diff: chrome/browser/ui/browser_list_aura.cc

Issue 9968101: Close notification windows while message loop is still active (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/browser_list.h" 5 #include "chrome/browser/ui/browser_list.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "chrome/common/chrome_switches.h" 8 #include "chrome/common/chrome_switches.h"
9 #include "chrome/browser/browser_process.h"
10 #include "chrome/browser/notifications/notification_ui_manager.h"
11
12 #if defined(USE_ASH)
13 #include "ash/shell.h"
14 #endif
9 15
10 // static 16 // static
11 void BrowserList::HandleAppExitingForPlatform() { 17 void BrowserList::HandleAppExitingForPlatform() {
18 // Close All non browser windows now. Those includes notifications
19 // and windows created by Ash (launcher, background, etc).
20 g_browser_process->notification_ui_manager()->CancelAll();
21 #if defined(USE_ASH)
22 // Shutdown the shell while the message loop is still alive.
23 // Don't delete ash shell instance yet because someone may try to
24 // access the shell, which will create new instance. We rather
25 // want to let it die if that happens.
26 ash::Shell::GetInstance()->Shutdown();
Ben Goodger (Google) 2012/04/10 22:35:02 can you delete the instance and then set shutdown_
oshima 2012/04/10 23:06:55 Looks like GetInstance no longer creates instance.
27 #endif
12 #if defined(OS_CHROMEOS) 28 #if defined(OS_CHROMEOS)
13 if (!CommandLine::ForCurrentProcess()->HasSwitch( 29 if (!CommandLine::ForCurrentProcess()->HasSwitch(
14 switches::kDisableZeroBrowsersOpenForTests)) { 30 switches::kDisableZeroBrowsersOpenForTests)) {
15 // App is exiting, call EndKeepAlive() on behalf of Aura Shell. 31 // App is exiting, call EndKeepAlive() on behalf of Aura Shell.
16 BrowserList::EndKeepAlive(); 32 BrowserList::EndKeepAlive();
17 // Make sure we have notified the session manager that we are exiting. 33 // Make sure we have notified the session manager that we are exiting.
18 // This might be called from FastShutdown() or CloseAllBrowsers(), but not 34 // This might be called from FastShutdown() or CloseAllBrowsers(), but not
19 // if something prevents a browser from closing before SetTryingToQuit() 35 // if something prevents a browser from closing before SetTryingToQuit()
20 // gets called (e.g. browser->TabsNeedBeforeUnloadFired() is true). 36 // gets called (e.g. browser->TabsNeedBeforeUnloadFired() is true).
21 // NotifyAndTerminate does nothing if called more than once. 37 // NotifyAndTerminate does nothing if called more than once.
22 BrowserList::NotifyAndTerminate(true); 38 BrowserList::NotifyAndTerminate(true);
23 } 39 }
24 #endif // OS_CHROMEOS 40 #endif // OS_CHROMEOS
25 } 41 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698