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

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

Issue 12212120: Replace most BrowserList::empty() and BrowserList::size() calls by multi-desktop aware calls. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge up to r182110 Created 7 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/browser_finder.h ('k') | chrome/browser/ui/browser_navigator_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_iterator.h" 8 #include "chrome/browser/ui/browser_iterator.h"
9 #include "chrome/browser/ui/browser_list_impl.h" 9 #include "chrome/browser/ui/browser_list_impl.h"
10 #include "chrome/browser/ui/browser_window.h" 10 #include "chrome/browser/ui/browser_window.h"
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 profile, Browser::FEATURE_NONE, kMatchAny); 190 profile, Browser::FEATURE_NONE, kMatchAny);
191 } 191 }
192 192
193 Browser* FindLastActiveWithHostDesktopType(HostDesktopType type) { 193 Browser* FindLastActiveWithHostDesktopType(HostDesktopType type) {
194 BrowserListImpl* browser_list_impl = BrowserListImpl::GetInstance(type); 194 BrowserListImpl* browser_list_impl = BrowserListImpl::GetInstance(type);
195 if (browser_list_impl) 195 if (browser_list_impl)
196 return browser_list_impl->GetLastActive(); 196 return browser_list_impl->GetLastActive();
197 return NULL; 197 return NULL;
198 } 198 }
199 199
200 size_t GetTotalBrowserCount() {
201 size_t count = 0;
202 for (HostDesktopType t = HOST_DESKTOP_TYPE_FIRST; t < HOST_DESKTOP_TYPE_COUNT;
203 t = static_cast<HostDesktopType>(t + 1)) {
204 count += BrowserListImpl::GetInstance(t)->size();
205 }
206 return count;
207 }
208
200 size_t GetBrowserCount(Profile* profile) { 209 size_t GetBrowserCount(Profile* profile) {
201 return GetBrowserCountImpl(profile, kDefaultHostDesktopType, kMatchAny); 210 return GetBrowserCountImpl(profile, kDefaultHostDesktopType, kMatchAny);
202 } 211 }
203 212
204 size_t GetTabbedBrowserCount(Profile* profile) { 213 size_t GetTabbedBrowserCount(Profile* profile) {
205 return GetBrowserCountImpl(profile, kDefaultHostDesktopType, kMatchTabbed); 214 return GetBrowserCountImpl(profile, kDefaultHostDesktopType, kMatchTabbed);
206 } 215 }
207 216
208 } // namespace chrome 217 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser_finder.h ('k') | chrome/browser/ui/browser_navigator_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698