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

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

Issue 1637943003: Remove HostDesktopType from BrowserList::GetInstance() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@screen-wrapper-land
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
Index: chrome/browser/ui/browser_iterator.cc
diff --git a/chrome/browser/ui/browser_iterator.cc b/chrome/browser/ui/browser_iterator.cc
index 4a69c1d7a0c2e6beaada0d142b6ac2d0fc08c9fe..e2c22d917f9f34038a240f4debda72bea32d0db9 100644
--- a/chrome/browser/ui/browser_iterator.cc
+++ b/chrome/browser/ui/browser_iterator.cc
@@ -4,32 +4,20 @@
#include "chrome/browser/ui/browser_iterator.h"
+// TODO(scottmg): Remove this file entirely. http://crbug.com/558054.
+
namespace chrome {
BrowserIterator::BrowserIterator()
- : current_browser_list_(BrowserList::GetInstance(HOST_DESKTOP_TYPE_FIRST)),
- current_iterator_(current_browser_list_->begin()),
- next_desktop_type_(
- static_cast<HostDesktopType>(HOST_DESKTOP_TYPE_FIRST + 1)) {
- NextBrowserListIfAtEnd();
+ : browser_list_(BrowserList::GetInstance()),
+ iterator_(browser_list_->begin()) {
}
BrowserIterator::~BrowserIterator() {
}
void BrowserIterator::Next() {
- ++current_iterator_;
- NextBrowserListIfAtEnd();
-}
-
-void BrowserIterator::NextBrowserListIfAtEnd() {
- // Make sure either |current_iterator_| is valid or done().
- while (current_iterator_ == current_browser_list_->end() &&
- next_desktop_type_ < HOST_DESKTOP_TYPE_COUNT) {
- current_browser_list_ = BrowserList::GetInstance(next_desktop_type_);
- current_iterator_ = current_browser_list_->begin();
- next_desktop_type_ = static_cast<HostDesktopType>(next_desktop_type_ + 1);
- }
+ ++iterator_;
}
} // namespace chrome

Powered by Google App Engine
This is Rietveld 408576698