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