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

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

Issue 10836218: Remove BrowserList::GetLastActive calls from window_sizer.cc et al. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_finder.h" 5 #include "chrome/browser/ui/browser_finder.h"
6 6
7 #include "chrome/browser/profiles/profile.h" 7 #include "chrome/browser/profiles/profile.h"
8 #include "chrome/browser/ui/browser_list.h" 8 #include "chrome/browser/ui/browser_list.h"
9 #include "chrome/browser/ui/browser_list_impl.h"
9 #include "chrome/browser/ui/browser_window.h" 10 #include "chrome/browser/ui/browser_window.h"
10 #include "chrome/browser/ui/tab_contents/tab_contents.h" 11 #include "chrome/browser/ui/tab_contents/tab_contents.h"
11 #include "chrome/browser/ui/tab_contents/tab_contents_iterator.h" 12 #include "chrome/browser/ui/tab_contents/tab_contents_iterator.h"
12 #include "chrome/browser/ui/tabs/tab_strip_model.h" 13 #include "chrome/browser/ui/tabs/tab_strip_model.h"
13 #include "content/public/browser/navigation_controller.h" 14 #include "content/public/browser/navigation_controller.h"
14 15
15 using content::WebContents; 16 using content::WebContents;
16 17
17 namespace browser { 18 namespace browser {
18 19
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 172
172 173
173 Browser* FindLastActiveWithProfile(Profile* profile) { 174 Browser* FindLastActiveWithProfile(Profile* profile) {
174 // We are only interested in last active browsers, so we don't fall back to 175 // We are only interested in last active browsers, so we don't fall back to
175 // all browsers like FindBrowserWith* do. 176 // all browsers like FindBrowserWith* do.
176 return FindBrowserMatching( 177 return FindBrowserMatching(
177 BrowserList::begin_last_active(), BrowserList::end_last_active(), profile, 178 BrowserList::begin_last_active(), BrowserList::end_last_active(), profile,
178 Browser::FEATURE_NONE, kMatchAny); 179 Browser::FEATURE_NONE, kMatchAny);
179 } 180 }
180 181
182 Browser* FindLastActiveWithHostDesktopType(chrome::HostDesktopType type) {
183 chrome::BrowserListImpl* browser_list_impl =
184 chrome::BrowserListImpl::GetInstance(type);
185 if (browser_list_impl) {
MAD 2012/08/13 21:25:10 no need for {}
robertshield 2012/08/13 21:37:41 Done.
186 return browser_list_impl->GetLastActive();
187 }
188 return NULL;
189 }
190
181 size_t GetBrowserCount(Profile* profile) { 191 size_t GetBrowserCount(Profile* profile) {
182 return GetBrowserCountImpl(profile, kMatchAny); 192 return GetBrowserCountImpl(profile, kMatchAny);
183 } 193 }
184 194
185 size_t GetTabbedBrowserCount(Profile* profile) { 195 size_t GetTabbedBrowserCount(Profile* profile) {
186 return GetBrowserCountImpl(profile, kMatchTabbed); 196 return GetBrowserCountImpl(profile, kMatchTabbed);
187 } 197 }
188 198
189 } // namespace browser 199 } // namespace browser
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698