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

Unified Diff: chrome/browser/app_controller_mac.mm

Issue 1644773003: Remove BrowserIterator (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@host-desktop-1
Patch Set: . Created 4 years, 11 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
« no previous file with comments | « chrome/browser/after_startup_task_utils.cc ('k') | chrome/browser/apps/app_window_interactive_uitest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/app_controller_mac.mm
diff --git a/chrome/browser/app_controller_mac.mm b/chrome/browser/app_controller_mac.mm
index 26784c9d25f8dc800ae2f79de302ffb0f20939d3..92701bd15a70913ad3b4d2c01561a5034800819d 100644
--- a/chrome/browser/app_controller_mac.mm
+++ b/chrome/browser/app_controller_mac.mm
@@ -53,7 +53,7 @@
#include "chrome/browser/ui/browser_commands.h"
#include "chrome/browser/ui/browser_dialogs.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_mac.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/chrome_pages.h"
@@ -490,7 +490,7 @@ class AppControllerProfileObserver : public ProfileInfoCacheObserver {
- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication*)app {
// If there are no windows, quit immediately.
- if (chrome::BrowserIterator().done() &&
+ if (BrowserList::GetInstance()->empty() &&
!AppWindowRegistryUtil::IsAppWindowVisibleInAnyProfile(0)) {
return NSTerminateNow;
}
@@ -635,10 +635,8 @@ class AppControllerProfileObserver : public ProfileInfoCacheObserver {
// completed, raise browser windows.
reopenTime_ = base::TimeTicks();
std::set<NSWindow*> browserWindows;
- for (chrome::BrowserIterator iter; !iter.done(); iter.Next()) {
- Browser* browser = *iter;
+ for (auto* browser : *BrowserList::GetInstance())
browserWindows.insert(browser->window()->GetNativeWindow());
- }
if (!browserWindows.empty()) {
ui::FocusWindowSetOnCurrentSpace(browserWindows);
}
@@ -1191,8 +1189,7 @@ class AppControllerProfileObserver : public ProfileInfoCacheObserver {
// notifications so we still need to open a new window.
if (hasVisibleWindows) {
std::set<NSWindow*> browserWindows;
- for (chrome::BrowserIterator iter; !iter.done(); iter.Next()) {
- Browser* browser = *iter;
+ for (auto* browser : *BrowserList::GetInstance()) {
// When focusing Chrome, don't focus any browser windows associated with
// a currently running app shim, so ignore them.
if (browser && browser->is_app()) {
« no previous file with comments | « chrome/browser/after_startup_task_utils.cc ('k') | chrome/browser/apps/app_window_interactive_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698