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

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

Issue 10967003: Add desktop type context to most existing instances of FindTabbedBrowser. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Pre-review pass. Created 8 years, 2 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
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 #ifndef CHROME_BROWSER_UI_BROWSER_FINDER_H_ 5 #ifndef CHROME_BROWSER_UI_BROWSER_FINDER_H_
6 #define CHROME_BROWSER_UI_BROWSER_FINDER_H_ 6 #define CHROME_BROWSER_UI_BROWSER_FINDER_H_
7 7
8 #include "chrome/browser/ui/browser.h" 8 #include "chrome/browser/ui/browser.h"
9 #include "ui/gfx/native_widget_types.h" 9 #include "ui/gfx/native_widget_types.h"
10 10
11 class Profile; 11 class Profile;
12 12
13 namespace contents { 13 namespace contents {
14 class NavigationController; 14 class NavigationController;
15 class WebContents; 15 class WebContents;
16 } 16 }
17 17
18 // Collection of functions to find Browsers based on various criteria. 18 // Collection of functions to find Browsers based on various criteria.
19 19
20 namespace browser { 20 namespace browser {
21 21
22 // Deprecated:
23 Browser* FindTabbedBrowser(Profile* profile,
24 bool match_original_profiles);
25
22 // Retrieve the last active tabbed browser with a profile matching |profile|. 26 // Retrieve the last active tabbed browser with a profile matching |profile|.
23 // If |match_original_profiles| is true, matching is done based on the 27 // If |match_original_profiles| is true, matching is done based on the
24 // original profile, eg profile->GetOriginalProfile() == 28 // original profile, eg profile->GetOriginalProfile() ==
25 // browser->profile()->GetOriginalProfile(). This has the effect of matching 29 // browser->profile()->GetOriginalProfile(). This has the effect of matching
26 // against both non-incognito and incognito profiles. If 30 // against both non-incognito and incognito profiles. If
27 // |match_original_profiles| is false, only an exact match may be returned. 31 // |match_original_profiles| is false, only an exact match may be returned.
28 Browser* FindTabbedBrowser(Profile* profile, bool match_original_profiles); 32 // |type| refers to the host desktop the returned browser should belong to.
33 Browser* FindTabbedBrowser(Profile* profile,
34 bool match_original_profiles,
35 chrome::HostDesktopType type);
36
37 // Deprecated
38 Browser* FindOrCreateTabbedBrowser(Profile* profile);
29 39
30 // Returns the first tabbed browser matching |profile|. If there is no tabbed 40 // Returns the first tabbed browser matching |profile|. If there is no tabbed
31 // browser a new one is created and returned. If a new browser is created it is 41 // browser a new one is created and returned for the desktop specified by
32 // not made visible. 42 // |type|. If a new browser is created it is not made visible.
33 Browser* FindOrCreateTabbedBrowser(Profile* profile); 43 Browser* FindOrCreateTabbedBrowser(Profile* profile,
44 chrome::HostDesktopType type);
34 45
35 // Find an existing browser window with any type. See comment above for 46 // Find an existing browser window with any type. See comment above for
36 // additional information. 47 // additional information.
37 Browser* FindAnyBrowser(Profile* profile, bool match_original_profiles); 48 Browser* FindAnyBrowser(Profile* profile, bool match_original_profiles);
38 49
39 // Find an existing browser window with the provided profile and hosted in the 50 // Find an existing browser window with the provided profile and hosted in the
40 // given desktop. Searches in the order of last activation. Only browsers that 51 // given desktop. Searches in the order of last activation. Only browsers that
41 // have been active can be returned. Returns NULL if no such browser currently 52 // have been active can be returned. Returns NULL if no such browser currently
42 // exists. 53 // exists.
43 Browser* FindBrowserWithProfile(Profile* profile, 54 Browser* FindBrowserWithProfile(Profile* profile,
(...skipping 23 matching lines...) Expand all
67 78
68 // Returns the number of browsers with the Profile |profile|. 79 // Returns the number of browsers with the Profile |profile|.
69 size_t GetBrowserCount(Profile* profile); 80 size_t GetBrowserCount(Profile* profile);
70 81
71 // Returns the number of tabbed browsers with the Profile |profile|. 82 // Returns the number of tabbed browsers with the Profile |profile|.
72 size_t GetTabbedBrowserCount(Profile* profile); 83 size_t GetTabbedBrowserCount(Profile* profile);
73 84
74 } // namespace browser 85 } // namespace browser
75 86
76 #endif // CHROME_BROWSER_UI_BROWSER_FINDER_H_ 87 #endif // CHROME_BROWSER_UI_BROWSER_FINDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698