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_API_TABS_TABS_API_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_TABS_TABS_API_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_API_TABS_TABS_API_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_TABS_TABS_API_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "chrome/browser/extensions/api/execute_code_function.h" | 12 #include "chrome/browser/extensions/api/execute_code_function.h" |
13 #include "chrome/browser/extensions/chrome_extension_function.h" | 13 #include "chrome/browser/extensions/chrome_extension_function.h" |
| 14 #include "chrome/browser/extensions/chrome_extension_function_details.h" |
14 #include "chrome/browser/ui/zoom/zoom_controller.h" | 15 #include "chrome/browser/ui/zoom/zoom_controller.h" |
15 #include "chrome/common/extensions/api/tabs.h" | 16 #include "chrome/common/extensions/api/tabs.h" |
16 #include "content/public/browser/notification_observer.h" | 17 #include "content/public/browser/notification_observer.h" |
17 #include "content/public/browser/notification_registrar.h" | 18 #include "content/public/browser/notification_registrar.h" |
18 #include "extensions/browser/api/capture_web_contents_function.h" | 19 #include "extensions/browser/api/capture_web_contents_function.h" |
19 #include "extensions/common/extension_resource.h" | 20 #include "extensions/common/extension_resource.h" |
20 #include "extensions/common/user_script.h" | 21 #include "extensions/common/user_script.h" |
21 #include "url/gurl.h" | 22 #include "url/gurl.h" |
22 | 23 |
23 class GURL; | 24 class GURL; |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 | 226 |
226 // Initialize the |execute_tab_id_| and |details_| if they haven't already | 227 // Initialize the |execute_tab_id_| and |details_| if they haven't already |
227 // been. Returns whether initialization was successful. | 228 // been. Returns whether initialization was successful. |
228 virtual bool Init() OVERRIDE; | 229 virtual bool Init() OVERRIDE; |
229 virtual bool CanExecuteScriptOnPage() OVERRIDE; | 230 virtual bool CanExecuteScriptOnPage() OVERRIDE; |
230 virtual ScriptExecutor* GetScriptExecutor() OVERRIDE; | 231 virtual ScriptExecutor* GetScriptExecutor() OVERRIDE; |
231 virtual bool IsWebView() const OVERRIDE; | 232 virtual bool IsWebView() const OVERRIDE; |
232 virtual const GURL& GetWebViewSrc() const OVERRIDE; | 233 virtual const GURL& GetWebViewSrc() const OVERRIDE; |
233 | 234 |
234 private: | 235 private: |
| 236 const ChromeExtensionFunctionDetails chrome_details_; |
| 237 |
235 // Id of tab which executes code. | 238 // Id of tab which executes code. |
236 int execute_tab_id_; | 239 int execute_tab_id_; |
237 }; | 240 }; |
238 | 241 |
239 class TabsExecuteScriptFunction : public ExecuteCodeInTabFunction { | 242 class TabsExecuteScriptFunction : public ExecuteCodeInTabFunction { |
240 protected: | 243 protected: |
241 virtual bool ShouldInsertCSS() const OVERRIDE; | 244 virtual bool ShouldInsertCSS() const OVERRIDE; |
242 | 245 |
243 private: | 246 private: |
244 virtual ~TabsExecuteScriptFunction() {} | 247 virtual ~TabsExecuteScriptFunction() {} |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 virtual ~TabsGetZoomSettingsFunction() {} | 308 virtual ~TabsGetZoomSettingsFunction() {} |
306 | 309 |
307 virtual bool RunAsync() OVERRIDE; | 310 virtual bool RunAsync() OVERRIDE; |
308 | 311 |
309 DECLARE_EXTENSION_FUNCTION("tabs.getZoomSettings", TABS_GETZOOMSETTINGS) | 312 DECLARE_EXTENSION_FUNCTION("tabs.getZoomSettings", TABS_GETZOOMSETTINGS) |
310 }; | 313 }; |
311 | 314 |
312 } // namespace extensions | 315 } // namespace extensions |
313 | 316 |
314 #endif // CHROME_BROWSER_EXTENSIONS_API_TABS_TABS_API_H_ | 317 #endif // CHROME_BROWSER_EXTENSIONS_API_TABS_TABS_API_H_ |
OLD | NEW |