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

Unified Diff: chrome/browser/ui/browser_finder.cc

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/ui/browser_browsertest.cc ('k') | chrome/browser/ui/browser_iterator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/browser_finder.cc
diff --git a/chrome/browser/ui/browser_finder.cc b/chrome/browser/ui/browser_finder.cc
index a785240e72ed299e8ec0d8102d6ca750a3f4bc0a..e79cae3a6f0624a1c2837170456e20d979542d2c 100644
--- a/chrome/browser/ui/browser_finder.cc
+++ b/chrome/browser/ui/browser_finder.cc
@@ -8,7 +8,6 @@
#include "build/build_config.h"
#include "chrome/browser/profiles/profile.h"
-#include "chrome/browser/ui/browser_iterator.h"
#include "chrome/browser/ui/browser_list.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/tab_contents/tab_contents_iterator.h"
@@ -176,9 +175,9 @@ Browser* FindBrowserWithProfile(Profile* profile,
}
Browser* FindBrowserWithID(SessionID::id_type desired_id) {
- for (BrowserIterator it; !it.done(); it.Next()) {
- if (it->session_id().id() == desired_id)
- return *it;
+ for (auto* browser : *BrowserList::GetInstance()) {
+ if (browser->session_id().id() == desired_id)
+ return browser;
}
return NULL;
}
@@ -186,8 +185,7 @@ Browser* FindBrowserWithID(SessionID::id_type desired_id) {
Browser* FindBrowserWithWindow(gfx::NativeWindow window) {
if (!window)
return NULL;
- for (BrowserIterator it; !it.done(); it.Next()) {
- Browser* browser = *it;
+ for (auto* browser : *BrowserList::GetInstance()) {
if (browser->window() && browser->window()->GetNativeWindow() == window)
return browser;
}
« no previous file with comments | « chrome/browser/ui/browser_browsertest.cc ('k') | chrome/browser/ui/browser_iterator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698