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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 // browser currently exists. | 45 // browser currently exists. |
46 Browser* FindBrowserWithID(SessionID::id_type desired_id); | 46 Browser* FindBrowserWithID(SessionID::id_type desired_id); |
47 | 47 |
48 // Find the browser represented by |window| or NULL if not found. | 48 // Find the browser represented by |window| or NULL if not found. |
49 Browser* FindBrowserWithWindow(gfx::NativeWindow window); | 49 Browser* FindBrowserWithWindow(gfx::NativeWindow window); |
50 | 50 |
51 // Find the browser containing |web_contents| or NULL if none is found. | 51 // Find the browser containing |web_contents| or NULL if none is found. |
52 // |web_contents| must not be NULL. | 52 // |web_contents| must not be NULL. |
53 Browser* FindBrowserWithWebContents(const content::WebContents* web_contents); | 53 Browser* FindBrowserWithWebContents(const content::WebContents* web_contents); |
54 | 54 |
| 55 // Returns the Browser which contains the tab with the given |
| 56 // NavigationController, also filling in |index| (if valid) with the tab's index |
| 57 // in the tab strip. Returns NULL if not found. This call is O(N) in the |
| 58 // number of tabs. |
| 59 Browser* FindBrowserForController( |
| 60 const content::NavigationController* controller, |
| 61 int* index); |
| 62 |
55 // Identical in behavior to BrowserList::GetLastActive(), except that the most | 63 // Identical in behavior to BrowserList::GetLastActive(), except that the most |
56 // recently open browser owned by |profile| is returned. If none exist, returns | 64 // recently open browser owned by |profile| is returned. If none exist, returns |
57 // NULL. WARNING: see warnings in BrowserList::GetLastActive(). | 65 // NULL. WARNING: see warnings in BrowserList::GetLastActive(). |
58 Browser* FindLastActiveWithProfile(Profile* profile); | 66 Browser* FindLastActiveWithProfile(Profile* profile); |
59 | 67 |
60 // Returns the number of browsers with the Profile |profile|. | 68 // Returns the number of browsers with the Profile |profile|. |
61 size_t GetBrowserCount(Profile* profile); | 69 size_t GetBrowserCount(Profile* profile); |
62 | 70 |
63 // Returns the number of tabbed browsers with the Profile |profile|. | 71 // Returns the number of tabbed browsers with the Profile |profile|. |
64 size_t GetTabbedBrowserCount(Profile* profile); | 72 size_t GetTabbedBrowserCount(Profile* profile); |
65 | 73 |
66 } // namespace browser | 74 } // namespace browser |
67 | 75 |
68 #endif // CHROME_BROWSER_UI_BROWSER_FINDER_H_ | 76 #endif // CHROME_BROWSER_UI_BROWSER_FINDER_H_ |
OLD | NEW |