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_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_list_impl.h" |
10 #include "chrome/browser/ui/browser_window.h" | 10 #include "chrome/browser/ui/browser_window.h" |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 i != browser_list_impl->end(); ++i) { | 117 i != browser_list_impl->end(); ++i) { |
118 if (BrowserMatches(*i, profile, Browser::FEATURE_NONE, match_types)) | 118 if (BrowserMatches(*i, profile, Browser::FEATURE_NONE, match_types)) |
119 count++; | 119 count++; |
120 } | 120 } |
121 } | 121 } |
122 return count; | 122 return count; |
123 } | 123 } |
124 | 124 |
125 } // namespace | 125 } // namespace |
126 | 126 |
127 namespace browser { | 127 namespace chrome { |
128 | 128 |
129 Browser* FindTabbedBrowser(Profile* profile, | 129 Browser* FindTabbedBrowser(Profile* profile, |
130 bool match_original_profiles, | 130 bool match_original_profiles, |
131 chrome::HostDesktopType type) { | 131 HostDesktopType type) { |
132 return FindBrowserWithTabbedOrAnyType(profile, | 132 return FindBrowserWithTabbedOrAnyType(profile, |
133 type, | 133 type, |
134 true, | 134 true, |
135 match_original_profiles); | 135 match_original_profiles); |
136 } | 136 } |
137 | 137 |
138 } // namespace browser | |
139 | |
140 namespace chrome { | |
141 | |
142 Browser* FindOrCreateTabbedBrowser(Profile* profile, HostDesktopType type) { | 138 Browser* FindOrCreateTabbedBrowser(Profile* profile, HostDesktopType type) { |
143 Browser* browser = browser::FindTabbedBrowser(profile, false, type); | 139 Browser* browser = FindTabbedBrowser(profile, false, type); |
144 if (!browser) | 140 if (!browser) |
145 browser = new Browser(Browser::CreateParams(profile, type)); | 141 browser = new Browser(Browser::CreateParams(profile, type)); |
146 return browser; | 142 return browser; |
147 } | 143 } |
148 | 144 |
149 Browser* FindAnyBrowser(Profile* profile, | 145 Browser* FindAnyBrowser(Profile* profile, |
150 bool match_original_profiles, | 146 bool match_original_profiles, |
151 HostDesktopType type) { | 147 HostDesktopType type) { |
152 return FindBrowserWithTabbedOrAnyType(profile, | 148 return FindBrowserWithTabbedOrAnyType(profile, |
153 type, | 149 type, |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 | 207 |
212 size_t GetBrowserCount(Profile* profile) { | 208 size_t GetBrowserCount(Profile* profile) { |
213 return GetBrowserCountImpl(profile, kDefaultHostDesktopType, kMatchAny); | 209 return GetBrowserCountImpl(profile, kDefaultHostDesktopType, kMatchAny); |
214 } | 210 } |
215 | 211 |
216 size_t GetTabbedBrowserCount(Profile* profile) { | 212 size_t GetTabbedBrowserCount(Profile* profile) { |
217 return GetBrowserCountImpl(profile, kDefaultHostDesktopType, kMatchTabbed); | 213 return GetBrowserCountImpl(profile, kDefaultHostDesktopType, kMatchTabbed); |
218 } | 214 } |
219 | 215 |
220 } // namespace chrome | 216 } // namespace chrome |
OLD | NEW |