| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_TABS_MODULE_H__ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_TABS_MODULE_H__ |
| 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_TABS_MODULE_H__ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_TABS_MODULE_H__ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "chrome/browser/extensions/extension_function.h" | 13 #include "chrome/browser/extensions/extension_function.h" |
| 14 #include "content/public/browser/notification_observer.h" | 14 #include "content/public/browser/notification_observer.h" |
| 15 #include "content/public/browser/notification_registrar.h" | 15 #include "content/public/browser/notification_registrar.h" |
| 16 #include "content/public/browser/web_contents_observer.h" | 16 #include "content/public/browser/web_contents_observer.h" |
| 17 #include "googleurl/src/gurl.h" | 17 #include "googleurl/src/gurl.h" |
| 18 | 18 |
| 19 class BackingStore; | 19 class BackingStore; |
| 20 class SkBitmap; | 20 class SkBitmap; |
| 21 | |
| 22 namespace base { | 21 namespace base { |
| 23 class DictionaryValue; | 22 class DictionaryValue; |
| 24 } // namespace base | 23 } // namespace base |
| 25 | 24 namespace content { |
| 25 class WebContents; |
| 26 } // namespace content |
| 26 // Windows | 27 // Windows |
| 27 class GetWindowFunction : public SyncExtensionFunction { | 28 class GetWindowFunction : public SyncExtensionFunction { |
| 28 virtual ~GetWindowFunction() {} | 29 virtual ~GetWindowFunction() {} |
| 29 virtual bool RunImpl() OVERRIDE; | 30 virtual bool RunImpl() OVERRIDE; |
| 30 DECLARE_EXTENSION_FUNCTION_NAME("windows.get") | 31 DECLARE_EXTENSION_FUNCTION_NAME("windows.get") |
| 31 }; | 32 }; |
| 32 class GetCurrentWindowFunction : public SyncExtensionFunction { | 33 class GetCurrentWindowFunction : public SyncExtensionFunction { |
| 33 virtual ~GetCurrentWindowFunction() {} | 34 virtual ~GetCurrentWindowFunction() {} |
| 34 virtual bool RunImpl() OVERRIDE; | 35 virtual bool RunImpl() OVERRIDE; |
| 35 DECLARE_EXTENSION_FUNCTION_NAME("windows.getCurrent") | 36 DECLARE_EXTENSION_FUNCTION_NAME("windows.getCurrent") |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 virtual bool RunImpl() OVERRIDE; | 106 virtual bool RunImpl() OVERRIDE; |
| 106 DECLARE_EXTENSION_FUNCTION_NAME("tabs.highlight") | 107 DECLARE_EXTENSION_FUNCTION_NAME("tabs.highlight") |
| 107 }; | 108 }; |
| 108 class UpdateTabFunction : public AsyncExtensionFunction, | 109 class UpdateTabFunction : public AsyncExtensionFunction, |
| 109 public content::WebContentsObserver { | 110 public content::WebContentsObserver { |
| 110 public: | 111 public: |
| 111 UpdateTabFunction(); | 112 UpdateTabFunction(); |
| 112 private: | 113 private: |
| 113 virtual ~UpdateTabFunction() {} | 114 virtual ~UpdateTabFunction() {} |
| 114 virtual bool RunImpl() OVERRIDE; | 115 virtual bool RunImpl() OVERRIDE; |
| 116 virtual void WebContentsDestroyed(content::WebContents* tab) OVERRIDE; |
| 115 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 117 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| 116 void OnExecuteCodeFinished(int request_id, | 118 void OnExecuteCodeFinished(int request_id, |
| 117 bool success, | 119 bool success, |
| 118 const std::string& error); | 120 const std::string& error); |
| 121 void PopulateResult(); |
| 122 |
| 123 content::WebContents* web_contents_; |
| 119 DECLARE_EXTENSION_FUNCTION_NAME("tabs.update") | 124 DECLARE_EXTENSION_FUNCTION_NAME("tabs.update") |
| 120 }; | 125 }; |
| 121 class MoveTabsFunction : public SyncExtensionFunction { | 126 class MoveTabsFunction : public SyncExtensionFunction { |
| 122 virtual ~MoveTabsFunction() {} | 127 virtual ~MoveTabsFunction() {} |
| 123 virtual bool RunImpl() OVERRIDE; | 128 virtual bool RunImpl() OVERRIDE; |
| 124 DECLARE_EXTENSION_FUNCTION_NAME("tabs.move") | 129 DECLARE_EXTENSION_FUNCTION_NAME("tabs.move") |
| 125 }; | 130 }; |
| 126 class ReloadTabFunction : public SyncExtensionFunction { | 131 class ReloadTabFunction : public SyncExtensionFunction { |
| 127 virtual ~ReloadTabFunction() {} | 132 virtual ~ReloadTabFunction() {} |
| 128 virtual bool RunImpl() OVERRIDE; | 133 virtual bool RunImpl() OVERRIDE; |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 // The format (JPEG vs PNG) of the resulting image. Set in RunImpl(). | 175 // The format (JPEG vs PNG) of the resulting image. Set in RunImpl(). |
| 171 ImageFormat image_format_; | 176 ImageFormat image_format_; |
| 172 | 177 |
| 173 // Quality setting to use when encoding jpegs. Set in RunImpl(). | 178 // Quality setting to use when encoding jpegs. Set in RunImpl(). |
| 174 int image_quality_; | 179 int image_quality_; |
| 175 | 180 |
| 176 DECLARE_EXTENSION_FUNCTION_NAME("tabs.captureVisibleTab") | 181 DECLARE_EXTENSION_FUNCTION_NAME("tabs.captureVisibleTab") |
| 177 }; | 182 }; |
| 178 | 183 |
| 179 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_TABS_MODULE_H__ | 184 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_TABS_MODULE_H__ |
| OLD | NEW |