| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |