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

Unified Diff: chrome/browser/lifetime/application_lifetime.cc

Issue 12212120: Replace most BrowserList::empty() and BrowserList::size() calls by multi-desktop aware calls. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/lifetime/application_lifetime.cc
diff --git a/chrome/browser/lifetime/application_lifetime.cc b/chrome/browser/lifetime/application_lifetime.cc
index 036f651f028fbb62e20bf42a158bd0cbd69324ea..cd85e7e90c703ee1d8edb165304df8fd7b5a13bf 100644
--- a/chrome/browser/lifetime/application_lifetime.cc
+++ b/chrome/browser/lifetime/application_lifetime.cc
@@ -17,8 +17,8 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/ui/browser.h"
+#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/browser_iterator.h"
-#include "chrome/browser/ui/browser_list.h"
#include "chrome/browser/ui/browser_tabstrip.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
@@ -120,7 +120,7 @@ void CloseAllBrowsers() {
// If there are no browsers, send the APP_TERMINATING action here. Otherwise,
// it will be sent by RemoveBrowser() when the last browser has closed.
if (browser_shutdown::ShuttingDownWithoutClosingBrowsers() ||
- BrowserList::empty()) {
+ chrome::GetTotalBrowserCount() == 0) {
chrome::NotifyAndTerminate(true);
chrome::OnAppExiting();
return;
@@ -321,9 +321,11 @@ void EndKeepAlive() {
// If there are no browsers open and we aren't already shutting down,
// initiate a shutdown. Also skips shutdown if this is a unit test
// (MessageLoop::current() == null).
- if (BrowserList::empty() && !browser_shutdown::IsTryingToQuit() &&
- MessageLoop::current())
+ if (chrome::GetTotalBrowserCount() == 0 &&
+ !browser_shutdown::IsTryingToQuit() &&
+ MessageLoop::current()) {
browser::CloseAllBrowsers();
+ }
}
}

Powered by Google App Engine
This is Rietveld 408576698