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

Side by Side Diff: chrome/browser/ui/browser_tab_strip_tracker.cc

Issue 1637943003: Remove HostDesktopType from BrowserList::GetInstance() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@screen-wrapper-land
Patch Set: mac2 Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/browser_tab_strip_tracker.h" 5 #include "chrome/browser/ui/browser_tab_strip_tracker.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "chrome/browser/ui/browser.h" 8 #include "chrome/browser/ui/browser.h"
9 #include "chrome/browser/ui/browser_iterator.h" 9 #include "chrome/browser/ui/browser_iterator.h"
10 #include "chrome/browser/ui/browser_list.h" 10 #include "chrome/browser/ui/browser_list.h"
(...skipping 16 matching lines...) Expand all
27 browser->tab_strip_model()->RemoveObserver(tab_strip_model_observer_); 27 browser->tab_strip_model()->RemoveObserver(tab_strip_model_observer_);
28 28
29 BrowserList::RemoveObserver(this); 29 BrowserList::RemoveObserver(this);
30 } 30 }
31 31
32 void BrowserTabStripTracker::Init(InitWith init_with) { 32 void BrowserTabStripTracker::Init(InitWith init_with) {
33 BrowserList::AddObserver(this); 33 BrowserList::AddObserver(this);
34 34
35 base::AutoReset<bool> restter(&is_processing_initial_browsers_, true); 35 base::AutoReset<bool> restter(&is_processing_initial_browsers_, true);
36 if (init_with == InitWith::BROWSERS_IN_ACTIVE_DESKTOP) { 36 if (init_with == InitWith::BROWSERS_IN_ACTIVE_DESKTOP) {
37 for (Browser* browser : 37 for (Browser* browser : *BrowserList::GetInstance())
38 *BrowserList::GetInstance(chrome::GetActiveDesktop()))
39 MaybeTrackBrowser(browser); 38 MaybeTrackBrowser(browser);
40 } else { 39 } else {
41 DCHECK(InitWith::ALL_BROWERS == init_with); 40 DCHECK(InitWith::ALL_BROWERS == init_with);
42 for (chrome::BrowserIterator it; !it.done(); it.Next()) 41 for (chrome::BrowserIterator it; !it.done(); it.Next())
43 MaybeTrackBrowser(*it); 42 MaybeTrackBrowser(*it);
44 } 43 }
45 } 44 }
46 45
47 void BrowserTabStripTracker::StopObservingAndSendOnBrowserRemoved() { 46 void BrowserTabStripTracker::StopObservingAndSendOnBrowserRemoved() {
48 Browsers current_browsers; 47 Browsers current_browsers;
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 browser->tab_strip_model()->RemoveObserver(tab_strip_model_observer_); 89 browser->tab_strip_model()->RemoveObserver(tab_strip_model_observer_);
91 90
92 if (browser_list_observer_) 91 if (browser_list_observer_)
93 browser_list_observer_->OnBrowserRemoved(browser); 92 browser_list_observer_->OnBrowserRemoved(browser);
94 } 93 }
95 94
96 void BrowserTabStripTracker::OnBrowserSetLastActive(Browser* browser) { 95 void BrowserTabStripTracker::OnBrowserSetLastActive(Browser* browser) {
97 if (browser_list_observer_) 96 if (browser_list_observer_)
98 browser_list_observer_->OnBrowserSetLastActive(browser); 97 browser_list_observer_->OnBrowserSetLastActive(browser);
99 } 98 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser_tab_restorer.cc ('k') | chrome/browser/ui/browser_tabrestore_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698