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 "ui/gfx/native_widget_types.h" | 9 #include "ui/gfx/native_widget_types.h" |
10 | 10 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 Browser* FindBrowserWithProfile(Profile* profile, | 53 Browser* FindBrowserWithProfile(Profile* profile, |
54 chrome::HostDesktopType type); | 54 chrome::HostDesktopType type); |
55 | 55 |
56 // Find an existing browser with the provided ID. Returns NULL if no such | 56 // Find an existing browser with the provided ID. Returns NULL if no such |
57 // browser currently exists. | 57 // browser currently exists. |
58 Browser* FindBrowserWithID(SessionID::id_type desired_id); | 58 Browser* FindBrowserWithID(SessionID::id_type desired_id); |
59 | 59 |
60 // Find the browser represented by |window| or NULL if not found. | 60 // Find the browser represented by |window| or NULL if not found. |
61 Browser* FindBrowserWithWindow(gfx::NativeWindow window); | 61 Browser* FindBrowserWithWindow(gfx::NativeWindow window); |
62 | 62 |
| 63 } // namespace browser |
| 64 |
| 65 namespace chrome { |
| 66 |
63 // Find the browser containing |web_contents| or NULL if none is found. | 67 // Find the browser containing |web_contents| or NULL if none is found. |
64 // |web_contents| must not be NULL. | 68 // |web_contents| must not be NULL. |
65 Browser* FindBrowserWithWebContents(const content::WebContents* web_contents); | 69 Browser* FindBrowserWithWebContents(const content::WebContents* web_contents); |
66 | 70 |
67 } // namespace browser | |
68 | |
69 namespace chrome { | |
70 | |
71 // Returns the Browser object owned by |profile| on the given desktop type | 71 // Returns the Browser object owned by |profile| on the given desktop type |
72 // whose window was most recently active. If no such Browsers exist, returns | 72 // whose window was most recently active. If no such Browsers exist, returns |
73 // NULL. | 73 // NULL. |
74 // | 74 // |
75 // WARNING: this is NULL until a browser becomes active. If during startup | 75 // WARNING: this is NULL until a browser becomes active. If during startup |
76 // a browser does not become active (perhaps the user launches Chrome, then | 76 // a browser does not become active (perhaps the user launches Chrome, then |
77 // clicks on another app before the first browser window appears) then this | 77 // clicks on another app before the first browser window appears) then this |
78 // returns NULL. | 78 // returns NULL. |
79 // WARNING #2: this will always be NULL in unit tests run on the bots. | 79 // WARNING #2: this will always be NULL in unit tests run on the bots. |
80 Browser* FindLastActiveWithProfile(Profile* profile, HostDesktopType type); | 80 Browser* FindLastActiveWithProfile(Profile* profile, HostDesktopType type); |
(...skipping 10 matching lines...) Expand all Loading... |
91 | 91 |
92 // Returns the number of browsers with the Profile |profile|. | 92 // Returns the number of browsers with the Profile |profile|. |
93 size_t GetBrowserCount(Profile* profile); | 93 size_t GetBrowserCount(Profile* profile); |
94 | 94 |
95 // Returns the number of tabbed browsers with the Profile |profile|. | 95 // Returns the number of tabbed browsers with the Profile |profile|. |
96 size_t GetTabbedBrowserCount(Profile* profile); | 96 size_t GetTabbedBrowserCount(Profile* profile); |
97 | 97 |
98 } // namespace chrome | 98 } // namespace chrome |
99 | 99 |
100 #endif // CHROME_BROWSER_UI_BROWSER_FINDER_H_ | 100 #endif // CHROME_BROWSER_UI_BROWSER_FINDER_H_ |
OLD | NEW |