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

Unified Diff: chrome/browser/ui/tab_contents/tab_contents_iterator.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/tab_contents/tab_contents_iterator.h ('k') | chrome/browser/ui/tabs/pinned_tab_codec.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/tab_contents/tab_contents_iterator.cc
diff --git a/chrome/browser/ui/tab_contents/tab_contents_iterator.cc b/chrome/browser/ui/tab_contents/tab_contents_iterator.cc
index bc035776d812f79fa5ef230901461b18e831bc46..34df98b4f108f366b760595987beed9229e36d9c 100644
--- a/chrome/browser/ui/tab_contents/tab_contents_iterator.cc
+++ b/chrome/browser/ui/tab_contents/tab_contents_iterator.cc
@@ -11,25 +11,29 @@
TabContentsIterator::TabContentsIterator()
: web_view_index_(-1),
- cur_(NULL) {
+ cur_(NULL),
+ browser_iterator_(BrowserList::GetInstance()->begin()) {
// Load the first WebContents into |cur_|.
Next();
}
+TabContentsIterator::~TabContentsIterator() {
+}
+
void TabContentsIterator::Next() {
// The current WebContents should be valid unless we are at the beginning.
DCHECK(cur_ || web_view_index_ == -1) << "Trying to advance past the end";
// Update |cur_| to the next WebContents in the list.
- while (!browser_iterator_.done()) {
- if (++web_view_index_ >= browser_iterator_->tab_strip_model()->count()) {
+ while (browser_iterator_ != BrowserList::GetInstance()->end()) {
+ if (++web_view_index_ >= (*browser_iterator_)->tab_strip_model()->count()) {
// Advance to the next Browser in the list.
- browser_iterator_.Next();
+ ++browser_iterator_;
web_view_index_ = -1;
continue;
}
- content::WebContents* next_tab = browser_iterator_->tab_strip_model()
+ content::WebContents* next_tab = (*browser_iterator_)->tab_strip_model()
->GetWebContentsAt(web_view_index_);
if (next_tab) {
cur_ = next_tab;
« no previous file with comments | « chrome/browser/ui/tab_contents/tab_contents_iterator.h ('k') | chrome/browser/ui/tabs/pinned_tab_codec.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698