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

Unified Diff: extensions/browser/api/webcam_private/webcam_private_api.h

Issue 1281263003: Change webcamPrivate.set/get/reset to async APIs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address Zach's comments. Created 5 years, 4 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
Index: extensions/browser/api/webcam_private/webcam_private_api.h
diff --git a/extensions/browser/api/webcam_private/webcam_private_api.h b/extensions/browser/api/webcam_private/webcam_private_api.h
index ec2cf93fed783d494c273c318494072c030bc098..a1ae78c2cb7d1a4491d1dc7ff87a937989446462 100644
--- a/extensions/browser/api/webcam_private/webcam_private_api.h
+++ b/extensions/browser/api/webcam_private/webcam_private_api.h
@@ -91,8 +91,6 @@ class WebcamPrivateOpenSerialWebcamFunction : public AsyncExtensionFunction {
protected:
~WebcamPrivateOpenSerialWebcamFunction() override;
-
- // AsyncExtensionFunction:
bool RunAsync() override;
private:
@@ -109,50 +107,64 @@ class WebcamPrivateCloseWebcamFunction : public AsyncExtensionFunction {
protected:
~WebcamPrivateCloseWebcamFunction() override;
-
- // AsyncApiFunction:
bool RunAsync() override;
private:
DISALLOW_COPY_AND_ASSIGN(WebcamPrivateCloseWebcamFunction);
};
-class WebcamPrivateSetFunction : public SyncExtensionFunction {
+class WebcamPrivateSetFunction : public AsyncExtensionFunction {
public:
WebcamPrivateSetFunction();
DECLARE_EXTENSION_FUNCTION("webcamPrivate.set", WEBCAMPRIVATE_SET);
protected:
~WebcamPrivateSetFunction() override;
- bool RunSync() override;
+ bool RunAsync() override;
private:
+ void OnSetWebcamParameters(bool success);
+
DISALLOW_COPY_AND_ASSIGN(WebcamPrivateSetFunction);
};
-class WebcamPrivateGetFunction : public SyncExtensionFunction {
+class WebcamPrivateGetFunction : public AsyncExtensionFunction {
public:
WebcamPrivateGetFunction();
DECLARE_EXTENSION_FUNCTION("webcamPrivate.get", WEBCAMPRIVATE_GET);
protected:
~WebcamPrivateGetFunction() override;
- bool RunSync() override;
+ bool RunAsync() override;
private:
+ enum InquiryType {
+ INQUIRY_PAN,
+ INQUIRY_TILT,
+ INQUIRY_ZOOM,
+ };
+ void OnGetWebcamParameters(InquiryType type, bool success, int value);
+
+ int pan_;
+ int tilt_;
+ int zoom_;
+ bool success_;
+
DISALLOW_COPY_AND_ASSIGN(WebcamPrivateGetFunction);
};
-class WebcamPrivateResetFunction : public SyncExtensionFunction {
+class WebcamPrivateResetFunction : public AsyncExtensionFunction {
public:
WebcamPrivateResetFunction();
DECLARE_EXTENSION_FUNCTION("webcamPrivate.reset", WEBCAMPRIVATE_RESET);
protected:
~WebcamPrivateResetFunction() override;
- bool RunSync() override;
+ bool RunAsync() override;
private:
+ void OnResetWebcam(bool success);
+
DISALLOW_COPY_AND_ASSIGN(WebcamPrivateResetFunction);
};

Powered by Google App Engine
This is Rietveld 408576698