Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1147)

Unified Diff: extensions/browser/api/capture_web_contents_function.h

Issue 522763002: Moving capture_web_contents_function to extensions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Documenting the inheritance of CaptureWebContentsFunction Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/chrome_browser_extensions.gypi ('k') | extensions/browser/api/capture_web_contents_function_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/api/capture_web_contents_function.h
diff --git a/chrome/browser/extensions/api/capture_web_contents_function.h b/extensions/browser/api/capture_web_contents_function.h
similarity index 81%
rename from chrome/browser/extensions/api/capture_web_contents_function.h
rename to extensions/browser/api/capture_web_contents_function.h
index 0f3b9dbaf67139a668df60db86fad262dae220d2..defef3a03be624204ed53d1dab42f98c4cb35bdd 100644
--- a/chrome/browser/extensions/api/capture_web_contents_function.h
+++ b/extensions/browser/api/capture_web_contents_function.h
@@ -5,7 +5,6 @@
#ifndef CHROME_BROWSER_EXTENSIONS_API_CAPTURE_WEB_CONTENTS_FUNCTION_H_
#define CHROME_BROWSER_EXTENSIONS_API_CAPTURE_WEB_CONTENTS_FUNCTION_H_
-#include "chrome/browser/extensions/chrome_extension_function.h"
#include "extensions/common/api/extension_types.h"
class SkBitmap;
@@ -18,12 +17,15 @@ namespace extensions {
// Base class for capturing visibile area of a WebContents.
// This is used by both webview.captureVisibleRegion and tabs.captureVisibleTab.
-class CaptureWebContentsFunction : public ChromeAsyncExtensionFunction {
+// The template parameter T should be either AsyncExtensionFunction or
+// ChromeAsyncExtensionFunction (in the cases the chrome Profile is required)
+template <typename T>
+class CaptureWebContentsFunction : public T {
public:
- CaptureWebContentsFunction();
+ CaptureWebContentsFunction() {}
protected:
- virtual ~CaptureWebContentsFunction();
+ virtual ~CaptureWebContentsFunction() {}
// ExtensionFunction implementation.
virtual bool HasPermission() OVERRIDE;
@@ -39,6 +41,9 @@ class CaptureWebContentsFunction : public ChromeAsyncExtensionFunction {
};
virtual void OnCaptureFailure(FailureReason reason) = 0;
+ // ValidationFailure override to match RunAsync().
+ static bool ValidationFailure(CaptureWebContentsFunction* function);
+
private:
typedef core_api::extension_types::ImageDetails ImageDetails;
« no previous file with comments | « chrome/chrome_browser_extensions.gypi ('k') | extensions/browser/api/capture_web_contents_function_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698