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

Side by Side Diff: chrome/browser/lifetime/application_lifetime_aura.cc

Issue 10409022: Move application lifetime functionality off BrowserList. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 7 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/lifetime/application_lifetime.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" 9 #include "chrome/browser/browser_process.h"
10 #include "chrome/browser/notifications/notification_ui_manager.h" 10 #include "chrome/browser/notifications/notification_ui_manager.h"
11 11
12 // static 12 namespace browser {
13 void BrowserList::HandleAppExitingForPlatform() { 13
14 void HandleAppExitingForPlatform() {
14 // Close All non browser windows now. Those includes notifications 15 // Close All non browser windows now. Those includes notifications
15 // and windows created by Ash (launcher, background, etc). 16 // and windows created by Ash (launcher, background, etc).
16 g_browser_process->notification_ui_manager()->CancelAll(); 17 g_browser_process->notification_ui_manager()->CancelAll();
17 // TODO(oshima): Close all non browser windows here while 18 // TODO(oshima): Close all non browser windows here while
18 // the message loop is still alive. 19 // the message loop is still alive.
19 #if defined(OS_CHROMEOS) 20 #if defined(OS_CHROMEOS)
20 if (!CommandLine::ForCurrentProcess()->HasSwitch( 21 if (!CommandLine::ForCurrentProcess()->HasSwitch(
21 switches::kDisableZeroBrowsersOpenForTests)) { 22 switches::kDisableZeroBrowsersOpenForTests)) {
22 // App is exiting, call EndKeepAlive() on behalf of Aura Shell. 23 // App is exiting, call EndKeepAlive() on behalf of Aura Shell.
23 BrowserList::EndKeepAlive(); 24 EndKeepAlive();
24 // Make sure we have notified the session manager that we are exiting. 25 // Make sure we have notified the session manager that we are exiting.
25 // This might be called from FastShutdown() or CloseAllBrowsers(), but not 26 // This might be called from FastShutdown() or CloseAllBrowsers(), but not
26 // if something prevents a browser from closing before SetTryingToQuit() 27 // if something prevents a browser from closing before SetTryingToQuit()
27 // gets called (e.g. browser->TabsNeedBeforeUnloadFired() is true). 28 // gets called (e.g. browser->TabsNeedBeforeUnloadFired() is true).
28 // NotifyAndTerminate does nothing if called more than once. 29 // NotifyAndTerminate does nothing if called more than once.
29 BrowserList::NotifyAndTerminate(true); 30 NotifyAndTerminate(true);
30 } 31 }
31 #endif // OS_CHROMEOS 32 #endif // OS_CHROMEOS
32 } 33 }
34
35 } // namespace browser
OLDNEW
« no previous file with comments | « chrome/browser/lifetime/application_lifetime.cc ('k') | chrome/browser/lifetime/application_lifetime_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698