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

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

Issue 10692195: Consolidate Browser Creation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 5 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_commands.cc ('k') | chrome/browser/ui/browser_list_impl.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_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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser_commands.cc ('k') | chrome/browser/ui/browser_list_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698