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" | |
13 #include "chrome/browser/extensions/api/execute_code_function.h" | 12 #include "chrome/browser/extensions/api/execute_code_function.h" |
14 #include "chrome/browser/extensions/chrome_extension_function.h" | 13 #include "chrome/browser/extensions/chrome_extension_function.h" |
15 #include "chrome/browser/ui/zoom/zoom_controller.h" | 14 #include "chrome/browser/ui/zoom/zoom_controller.h" |
16 #include "chrome/common/extensions/api/tabs.h" | 15 #include "chrome/common/extensions/api/tabs.h" |
17 #include "content/public/browser/notification_observer.h" | 16 #include "content/public/browser/notification_observer.h" |
18 #include "content/public/browser/notification_registrar.h" | 17 #include "content/public/browser/notification_registrar.h" |
| 18 #include "extensions/browser/api/capture_web_contents_function.h" |
19 #include "extensions/common/extension_resource.h" | 19 #include "extensions/common/extension_resource.h" |
20 #include "extensions/common/user_script.h" | 20 #include "extensions/common/user_script.h" |
21 #include "url/gurl.h" | 21 #include "url/gurl.h" |
22 | 22 |
23 class GURL; | 23 class GURL; |
24 class SkBitmap; | 24 class SkBitmap; |
25 class TabStripModel; | 25 class TabStripModel; |
26 | 26 |
27 namespace base { | 27 namespace base { |
28 class DictionaryValue; | 28 class DictionaryValue; |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 virtual bool RunAsync() OVERRIDE; | 188 virtual bool RunAsync() OVERRIDE; |
189 | 189 |
190 virtual void Observe(int type, | 190 virtual void Observe(int type, |
191 const content::NotificationSource& source, | 191 const content::NotificationSource& source, |
192 const content::NotificationDetails& details) OVERRIDE; | 192 const content::NotificationDetails& details) OVERRIDE; |
193 void GotLanguage(const std::string& language); | 193 void GotLanguage(const std::string& language); |
194 content::NotificationRegistrar registrar_; | 194 content::NotificationRegistrar registrar_; |
195 DECLARE_EXTENSION_FUNCTION("tabs.detectLanguage", TABS_DETECTLANGUAGE) | 195 DECLARE_EXTENSION_FUNCTION("tabs.detectLanguage", TABS_DETECTLANGUAGE) |
196 }; | 196 }; |
197 class TabsCaptureVisibleTabFunction | 197 class TabsCaptureVisibleTabFunction |
198 : public extensions::CaptureWebContentsFunction { | 198 : public extensions::CaptureWebContentsFunction< |
| 199 ChromeAsyncExtensionFunction> { |
199 public: | 200 public: |
200 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); | 201 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); |
201 | 202 |
202 protected: | 203 protected: |
203 virtual ~TabsCaptureVisibleTabFunction() {} | 204 virtual ~TabsCaptureVisibleTabFunction() {} |
204 | 205 |
205 private: | 206 private: |
206 // extensions::CaptureWebContentsFunction: | 207 // extensions::CaptureWebContentsFunction: |
207 virtual bool IsScreenshotEnabled() OVERRIDE; | 208 virtual bool IsScreenshotEnabled() OVERRIDE; |
208 virtual content::WebContents* GetWebContentsForID(int id) OVERRIDE; | 209 virtual content::WebContents* GetWebContentsForID(int id) OVERRIDE; |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 virtual ~TabsGetZoomSettingsFunction() {} | 305 virtual ~TabsGetZoomSettingsFunction() {} |
305 | 306 |
306 virtual bool RunAsync() OVERRIDE; | 307 virtual bool RunAsync() OVERRIDE; |
307 | 308 |
308 DECLARE_EXTENSION_FUNCTION("tabs.getZoomSettings", TABS_GETZOOMSETTINGS) | 309 DECLARE_EXTENSION_FUNCTION("tabs.getZoomSettings", TABS_GETZOOMSETTINGS) |
309 }; | 310 }; |
310 | 311 |
311 } // namespace extensions | 312 } // namespace extensions |
312 | 313 |
313 #endif // CHROME_BROWSER_EXTENSIONS_API_TABS_TABS_API_H_ | 314 #endif // CHROME_BROWSER_EXTENSIONS_API_TABS_TABS_API_H_ |
OLD | NEW |