Chromium Code Reviews| Index: chrome/browser/extensions/api/tabs/tabs_api.h |
| diff --git a/chrome/browser/extensions/api/tabs/tabs_api.h b/chrome/browser/extensions/api/tabs/tabs_api.h |
| index b398e70c10d922a5d580e57890fb54a6e511300c..e0a5f241efe5d6f45178269ed407ca3bd89afb14 100644 |
| --- a/chrome/browser/extensions/api/tabs/tabs_api.h |
| +++ b/chrome/browser/extensions/api/tabs/tabs_api.h |
| @@ -15,8 +15,8 @@ |
| #include "components/ui/zoom/zoom_controller.h" |
| #include "content/public/browser/notification_observer.h" |
| #include "content/public/browser/notification_registrar.h" |
| -#include "extensions/browser/api/capture_web_contents_function.h" |
| #include "extensions/browser/api/execute_code_function.h" |
| +#include "extensions/browser/api/web_contents_capture_client.h" |
| #include "extensions/common/extension_resource.h" |
| #include "extensions/common/user_script.h" |
| #include "url/gurl.h" |
| @@ -195,21 +195,29 @@ class TabsDetectLanguageFunction : public ChromeAsyncExtensionFunction, |
| content::NotificationRegistrar registrar_; |
| DECLARE_EXTENSION_FUNCTION("tabs.detectLanguage", TABS_DETECTLANGUAGE) |
| }; |
| + |
| class TabsCaptureVisibleTabFunction |
| - : public extensions::CaptureWebContentsFunction { |
| + : public extensions::WebContentsCaptureClient, |
| + public AsyncExtensionFunction { |
| public: |
| TabsCaptureVisibleTabFunction(); |
| static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); |
| + // ExtensionFunction implementation. |
| + bool HasPermission() override; |
| + bool RunAsync() override; |
|
Charlie Reis
2016/01/19 22:45:36
This is deprecated (as afakhry mentioned to me the
wjmaclean
2016/01/20 15:32:36
In the derived WebView function I used RunAsyncSaf
|
| + |
| protected: |
| ~TabsCaptureVisibleTabFunction() override {} |
| private: |
| ChromeExtensionFunctionDetails chrome_details_; |
| - // extensions::CaptureWebContentsFunction: |
| + content::WebContents* GetWebContentsForID(int window_id); |
| + |
| + // extensions::WebContentsCaptureClient: |
| bool IsScreenshotEnabled() override; |
| - content::WebContents* GetWebContentsForID(int id) override; |
| + void OnCaptureSuccess(const SkBitmap& bitmap) override; |
| void OnCaptureFailure(FailureReason reason) override; |
| DECLARE_EXTENSION_FUNCTION("tabs.captureVisibleTab", TABS_CAPTUREVISIBLETAB) |