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_window.h" | 9 #include "chrome/browser/ui/browser_window.h" |
10 #include "chrome/browser/ui/tab_contents/tab_contents.h" | 10 #include "chrome/browser/ui/tab_contents/tab_contents.h" |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 | 104 |
105 Browser* FindTabbedBrowser(Profile* profile, bool match_original_profiles) { | 105 Browser* FindTabbedBrowser(Profile* profile, bool match_original_profiles) { |
106 return FindBrowserWithTabbedOrAnyType(profile, | 106 return FindBrowserWithTabbedOrAnyType(profile, |
107 true, | 107 true, |
108 match_original_profiles); | 108 match_original_profiles); |
109 } | 109 } |
110 | 110 |
111 Browser* FindOrCreateTabbedBrowser(Profile* profile) { | 111 Browser* FindOrCreateTabbedBrowser(Profile* profile) { |
112 Browser* browser = FindTabbedBrowser(profile, false); | 112 Browser* browser = FindTabbedBrowser(profile, false); |
113 if (!browser) | 113 if (!browser) |
114 browser = Browser::Create(profile); | 114 browser = new Browser(Browser::CreateParams(profile)); |
115 return browser; | 115 return browser; |
116 } | 116 } |
117 | 117 |
118 Browser* FindAnyBrowser(Profile* profile, bool match_original_profiles) { | 118 Browser* FindAnyBrowser(Profile* profile, bool match_original_profiles) { |
119 return FindBrowserWithTabbedOrAnyType(profile, | 119 return FindBrowserWithTabbedOrAnyType(profile, |
120 false, | 120 false, |
121 match_original_profiles); | 121 match_original_profiles); |
122 } | 122 } |
123 | 123 |
124 Browser* FindBrowserWithProfile(Profile* profile) { | 124 Browser* FindBrowserWithProfile(Profile* profile) { |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 | 163 |
164 size_t GetBrowserCount(Profile* profile) { | 164 size_t GetBrowserCount(Profile* profile) { |
165 return GetBrowserCountImpl(profile, kMatchAny); | 165 return GetBrowserCountImpl(profile, kMatchAny); |
166 } | 166 } |
167 | 167 |
168 size_t GetTabbedBrowserCount(Profile* profile) { | 168 size_t GetTabbedBrowserCount(Profile* profile) { |
169 return GetBrowserCountImpl(profile, kMatchTabbed); | 169 return GetBrowserCountImpl(profile, kMatchTabbed); |
170 } | 170 } |
171 | 171 |
172 } // namespace browser | 172 } // namespace browser |
OLD | NEW |