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 #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 "chrome/browser/ui/host_desktop.h" | 9 #include "chrome/browser/ui/host_desktop.h" |
10 #include "ui/gfx/native_widget_types.h" | 10 #include "ui/gfx/native_widget_types.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 | 32 |
33 // Deprecated. Call FindOrCreateTabbedBrowser and pass a desktop type instead. | 33 // Deprecated. Call FindOrCreateTabbedBrowser and pass a desktop type instead. |
34 Browser* FindOrCreateTabbedBrowserDeprecated(Profile* profile); | 34 Browser* FindOrCreateTabbedBrowserDeprecated(Profile* profile); |
35 | 35 |
36 // Returns the first tabbed browser matching |profile|. If there is no tabbed | 36 // Returns the first tabbed browser matching |profile|. If there is no tabbed |
37 // browser a new one is created and returned for the desktop specified by | 37 // browser a new one is created and returned for the desktop specified by |
38 // |type|. If a new browser is created it is not made visible. | 38 // |type|. If a new browser is created it is not made visible. |
39 Browser* FindOrCreateTabbedBrowser(Profile* profile, | 39 Browser* FindOrCreateTabbedBrowser(Profile* profile, |
40 chrome::HostDesktopType type); | 40 chrome::HostDesktopType type); |
41 | 41 |
| 42 } // namespace browser |
| 43 |
| 44 namespace chrome { |
| 45 |
42 // Finds an existing browser window of any kind. | 46 // Finds an existing browser window of any kind. |
43 // |type| refers to the host desktop the returned browser should belong to. | 47 // |type| refers to the host desktop the returned browser should belong to. |
44 Browser* FindAnyBrowser(Profile* profile, | 48 Browser* FindAnyBrowser(Profile* profile, |
45 bool match_original_profiles, | 49 bool match_original_profiles, |
46 chrome::HostDesktopType type); | 50 HostDesktopType type); |
47 | 51 |
48 // Find an existing browser window with the provided profile and hosted in the | 52 // Find an existing browser window with the provided profile and hosted in the |
49 // given desktop. Searches in the order of last activation. Only browsers that | 53 // given desktop. Searches in the order of last activation. Only browsers that |
50 // have been active can be returned. Returns NULL if no such browser currently | 54 // have been active can be returned. Returns NULL if no such browser currently |
51 // exists. | 55 // exists. |
52 Browser* FindBrowserWithProfile(Profile* profile, | 56 Browser* FindBrowserWithProfile(Profile* profile, HostDesktopType type); |
53 chrome::HostDesktopType type); | |
54 | |
55 } // namespace browser | |
56 | |
57 namespace chrome { | |
58 | 57 |
59 // Find an existing browser with the provided ID. Returns NULL if no such | 58 // Find an existing browser with the provided ID. Returns NULL if no such |
60 // browser currently exists. | 59 // browser currently exists. |
61 Browser* FindBrowserWithID(SessionID::id_type desired_id); | 60 Browser* FindBrowserWithID(SessionID::id_type desired_id); |
62 | 61 |
63 // Find the browser represented by |window| or NULL if not found. | 62 // Find the browser represented by |window| or NULL if not found. |
64 Browser* FindBrowserWithWindow(gfx::NativeWindow window); | 63 Browser* FindBrowserWithWindow(gfx::NativeWindow window); |
65 | 64 |
66 // Find the browser containing |web_contents| or NULL if none is found. | 65 // Find the browser containing |web_contents| or NULL if none is found. |
67 // |web_contents| must not be NULL. | 66 // |web_contents| must not be NULL. |
(...skipping 26 matching lines...) Expand all Loading... |
94 | 93 |
95 // Returns the number of browsers with the Profile |profile|. | 94 // Returns the number of browsers with the Profile |profile|. |
96 size_t GetBrowserCount(Profile* profile); | 95 size_t GetBrowserCount(Profile* profile); |
97 | 96 |
98 // Returns the number of tabbed browsers with the Profile |profile|. | 97 // Returns the number of tabbed browsers with the Profile |profile|. |
99 size_t GetTabbedBrowserCount(Profile* profile); | 98 size_t GetTabbedBrowserCount(Profile* profile); |
100 | 99 |
101 } // namespace chrome | 100 } // namespace chrome |
102 | 101 |
103 #endif // CHROME_BROWSER_UI_BROWSER_FINDER_H_ | 102 #endif // CHROME_BROWSER_UI_BROWSER_FINDER_H_ |
OLD | NEW |