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_EXTENSIONS_EXTENSION_TAB_UTIL_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_TAB_UTIL_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_TAB_UTIL_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_TAB_UTIL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
11 #include "ui/base/window_open_disposition.h" | 11 #include "ui/base/window_open_disposition.h" |
12 | 12 |
13 class Browser; | 13 class Browser; |
14 class ChromeUIThreadExtensionFunction; | 14 class ChromeUIThreadExtensionFunction; |
15 class GURL; | 15 class GURL; |
16 class Profile; | 16 class Profile; |
17 class TabStripModel; | 17 class TabStripModel; |
18 | 18 |
19 namespace base { | 19 namespace base { |
20 class DictionaryValue; | 20 class DictionaryValue; |
21 class ListValue; | 21 class ListValue; |
22 } | 22 } |
23 | 23 |
24 namespace content { | 24 namespace content { |
| 25 class BrowserContext; |
25 class WebContents; | 26 class WebContents; |
26 } | 27 } |
27 | 28 |
28 namespace gfx { | 29 namespace gfx { |
29 class Rect; | 30 class Rect; |
30 } | 31 } |
31 | 32 |
32 namespace extensions { | 33 namespace extensions { |
33 | 34 |
34 class Extension; | 35 class Extension; |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 | 117 |
117 // Gets the |tab_strip_model| and |tab_index| for the given |web_contents|. | 118 // Gets the |tab_strip_model| and |tab_index| for the given |web_contents|. |
118 static bool GetTabStripModel(const content::WebContents* web_contents, | 119 static bool GetTabStripModel(const content::WebContents* web_contents, |
119 TabStripModel** tab_strip_model, | 120 TabStripModel** tab_strip_model, |
120 int* tab_index); | 121 int* tab_index); |
121 static bool GetDefaultTab(Browser* browser, | 122 static bool GetDefaultTab(Browser* browser, |
122 content::WebContents** contents, | 123 content::WebContents** contents, |
123 int* tab_id); | 124 int* tab_id); |
124 // Any out parameter (|browser|, |tab_strip|, |contents|, & |tab_index|) may | 125 // Any out parameter (|browser|, |tab_strip|, |contents|, & |tab_index|) may |
125 // be NULL and will not be set within the function. | 126 // be NULL and will not be set within the function. |
126 static bool GetTabById(int tab_id, Profile* profile, bool incognito_enabled, | 127 static bool GetTabById(int tab_id, |
| 128 content::BrowserContext* browser_context, |
| 129 bool incognito_enabled, |
127 Browser** browser, | 130 Browser** browser, |
128 TabStripModel** tab_strip, | 131 TabStripModel** tab_strip, |
129 content::WebContents** contents, | 132 content::WebContents** contents, |
130 int* tab_index); | 133 int* tab_index); |
131 | 134 |
132 // Takes |url_string| and returns a GURL which is either valid and absolute | 135 // Takes |url_string| and returns a GURL which is either valid and absolute |
133 // or invalid. If |url_string| is not directly interpretable as a valid (it is | 136 // or invalid. If |url_string| is not directly interpretable as a valid (it is |
134 // likely a relative URL) an attempt is made to resolve it. |extension| is | 137 // likely a relative URL) an attempt is made to resolve it. |extension| is |
135 // provided so it can be resolved relative to its extension base | 138 // provided so it can be resolved relative to its extension base |
136 // (chrome-extension://<id>/). Using the source frame url would be more | 139 // (chrome-extension://<id>/). Using the source frame url would be more |
(...skipping 20 matching lines...) Expand all Loading... |
157 static WindowController* GetWindowControllerOfTab( | 160 static WindowController* GetWindowControllerOfTab( |
158 const content::WebContents* web_contents); | 161 const content::WebContents* web_contents); |
159 | 162 |
160 // Open the extension's options page. | 163 // Open the extension's options page. |
161 static void OpenOptionsPage(const Extension* extension, Browser* browser); | 164 static void OpenOptionsPage(const Extension* extension, Browser* browser); |
162 }; | 165 }; |
163 | 166 |
164 } // namespace extensions | 167 } // namespace extensions |
165 | 168 |
166 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_TAB_UTIL_H_ | 169 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_TAB_UTIL_H_ |
OLD | NEW |