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 ChromeExtensionFunctionDetails; | |
14 class ChromeUIThreadExtensionFunction; | 15 class ChromeUIThreadExtensionFunction; |
16 class ExtensionFunction; | |
15 class GURL; | 17 class GURL; |
16 class Profile; | 18 class Profile; |
17 class TabStripModel; | 19 class TabStripModel; |
18 | 20 |
19 namespace base { | 21 namespace base { |
20 class DictionaryValue; | 22 class DictionaryValue; |
21 class ListValue; | 23 class ListValue; |
22 } | 24 } |
23 | 25 |
24 namespace content { | 26 namespace content { |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
65 const OpenTabParams& params, | 67 const OpenTabParams& params, |
66 std::string* error); | 68 std::string* error); |
67 | 69 |
68 static int GetWindowId(const Browser* browser); | 70 static int GetWindowId(const Browser* browser); |
69 static int GetWindowIdOfTabStripModel(const TabStripModel* tab_strip_model); | 71 static int GetWindowIdOfTabStripModel(const TabStripModel* tab_strip_model); |
70 static int GetTabId(const content::WebContents* web_contents); | 72 static int GetTabId(const content::WebContents* web_contents); |
71 static std::string GetTabStatusText(bool is_loading); | 73 static std::string GetTabStatusText(bool is_loading); |
72 static int GetWindowIdOfTab(const content::WebContents* web_contents); | 74 static int GetWindowIdOfTab(const content::WebContents* web_contents); |
73 static base::ListValue* CreateTabList(const Browser* browser, | 75 static base::ListValue* CreateTabList(const Browser* browser, |
74 const Extension* extension); | 76 const Extension* extension); |
77 | |
78 // DEPRECATED: Please consider using ChromeExtensionFunctionDetails. | |
Ken Rockot(use gerrit already)
2014/09/05 19:55:31
nit: Maybe point out the relevant overload of the
Fady Samuel
2014/09/08 14:54:52
Also, the typical style is TODO(ldap): ...
| |
75 static Browser* GetBrowserFromWindowID( | 79 static Browser* GetBrowserFromWindowID( |
76 ChromeUIThreadExtensionFunction* function, | 80 ChromeUIThreadExtensionFunction* function, |
77 int window_id, | 81 int window_id, |
78 std::string* error_message); | 82 std::string* error_message); |
79 | 83 |
84 static Browser* GetBrowserFromWindowID( | |
85 ExtensionFunction* function, | |
86 const ChromeExtensionFunctionDetails& details, | |
87 int window_id, | |
88 std::string* error_message); | |
89 | |
80 // Creates a Tab object (see chrome/common/extensions/api/tabs.json) with | 90 // Creates a Tab object (see chrome/common/extensions/api/tabs.json) with |
81 // information about the state of a browser tab. Depending on the | 91 // information about the state of a browser tab. Depending on the |
82 // permissions of the extension, the object may or may not include sensitive | 92 // permissions of the extension, the object may or may not include sensitive |
83 // data such as the tab's URL. | 93 // data such as the tab's URL. |
84 static base::DictionaryValue* CreateTabValue( | 94 static base::DictionaryValue* CreateTabValue( |
85 content::WebContents* web_contents, | 95 content::WebContents* web_contents, |
86 const Extension* extension) { | 96 const Extension* extension) { |
87 return CreateTabValue(web_contents, NULL, -1, extension); | 97 return CreateTabValue(web_contents, NULL, -1, extension); |
88 } | 98 } |
89 static base::DictionaryValue* CreateTabValue( | 99 static base::DictionaryValue* CreateTabValue( |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
160 static WindowController* GetWindowControllerOfTab( | 170 static WindowController* GetWindowControllerOfTab( |
161 const content::WebContents* web_contents); | 171 const content::WebContents* web_contents); |
162 | 172 |
163 // Open the extension's options page. | 173 // Open the extension's options page. |
164 static void OpenOptionsPage(const Extension* extension, Browser* browser); | 174 static void OpenOptionsPage(const Extension* extension, Browser* browser); |
165 }; | 175 }; |
166 | 176 |
167 } // namespace extensions | 177 } // namespace extensions |
168 | 178 |
169 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_TAB_UTIL_H_ | 179 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_TAB_UTIL_H_ |
OLD | NEW |