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

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

Issue 14113053: chrome: Use base::MessageLoop. (Part 3) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase again Created 7 years, 6 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
« no previous file with comments | « chrome/browser/jankometer.cc ('k') | chrome/browser/logging_chrome_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/lifetime/application_lifetime.h" 5 #include "chrome/browser/lifetime/application_lifetime.h"
6 6
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 if (!g_browser_process) return; 295 if (!g_browser_process) return;
296 296
297 // Allow the app to shutdown again. 297 // Allow the app to shutdown again.
298 if (!WillKeepAlive()) { 298 if (!WillKeepAlive()) {
299 g_browser_process->ReleaseModule(); 299 g_browser_process->ReleaseModule();
300 // If there are no browsers open and we aren't already shutting down, 300 // If there are no browsers open and we aren't already shutting down,
301 // initiate a shutdown. Also skips shutdown if this is a unit test 301 // initiate a shutdown. Also skips shutdown if this is a unit test
302 // (MessageLoop::current() == null). 302 // (MessageLoop::current() == null).
303 if (chrome::GetTotalBrowserCount() == 0 && 303 if (chrome::GetTotalBrowserCount() == 0 &&
304 !browser_shutdown::IsTryingToQuit() && 304 !browser_shutdown::IsTryingToQuit() &&
305 MessageLoop::current()) { 305 base::MessageLoop::current()) {
306 CloseAllBrowsers(); 306 CloseAllBrowsers();
307 } 307 }
308 } 308 }
309 } 309 }
310 310
311 bool WillKeepAlive() { 311 bool WillKeepAlive() {
312 return g_keep_alive_count > 0; 312 return g_keep_alive_count > 0;
313 } 313 }
314 314
315 void NotifyAppTerminating() { 315 void NotifyAppTerminating() {
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 // environment is still active. 380 // environment is still active.
381 if (browser->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_NATIVE) 381 if (browser->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_NATIVE)
382 return !ash::Shell::HasInstance(); 382 return !ash::Shell::HasInstance();
383 else if (browser->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH) 383 else if (browser->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH)
384 return BrowserList::GetInstance(chrome::HOST_DESKTOP_TYPE_NATIVE)->empty(); 384 return BrowserList::GetInstance(chrome::HOST_DESKTOP_TYPE_NATIVE)->empty();
385 #endif 385 #endif
386 return true; 386 return true;
387 } 387 }
388 388
389 } // namespace chrome 389 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/jankometer.cc ('k') | chrome/browser/logging_chrome_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698