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

Unified Diff: extensions/browser/api/webcam_private/visca_webcam.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/visca_webcam.h
diff --git a/extensions/browser/api/webcam_private/visca_webcam.h b/extensions/browser/api/webcam_private/visca_webcam.h
index a24c747658b3ee7a32d69067fc831dad78dbf0f0..d81a9a43192bc66bb2e856b696198e6ccdee99a9 100644
--- a/extensions/browser/api/webcam_private/visca_webcam.h
+++ b/extensions/browser/api/webcam_private/visca_webcam.h
@@ -30,11 +30,9 @@ class ViscaWebcam : public Webcam {
private:
~ViscaWebcam() override;
- enum CommandType {
- COMMAND,
+ enum InquiryType {
INQUIRY_PAN,
INQUIRY_TILT,
- INQUIRY_PAN_TILT,
INQUIRY_ZOOM,
};
@@ -66,24 +64,34 @@ class ViscaWebcam : public Webcam {
void OnReceiveCompleted(const CommandCompleteCallback& callback,
const std::vector<char>& data,
api::serial::ReceiveError error);
+
// Callback function that will be called after the send and reply of a command
- // are both completed. Update |value| according to |type| and |response| if
- // necessory.
- void OnCommandCompleted(CommandType type,
- int* value,
+ // are both completed.
+ void OnCommandCompleted(const SetPTZCompleteCallback& callback,
+ bool success,
+ const std::vector<char>& response);
+ // Callback function that will be called after the send and reply of an
+ // inquiry are both completed.
+ void OnInquiryCompleted(InquiryType type,
+ const GetPTZCompleteCallback& callback,
bool success,
const std::vector<char>& response);
// Webcam Overrides:
- void Reset(bool pan, bool tilt, bool zoom) override;
- bool GetPan(int* value) override;
- bool GetTilt(int* value) override;
- bool GetZoom(int* value) override;
- bool SetPan(int value) override;
- bool SetTilt(int value) override;
- bool SetZoom(int value) override;
- bool SetPanDirection(PanDirection direction) override;
- bool SetTiltDirection(TiltDirection direction) override;
+ void GetPan(const GetPTZCompleteCallback& callback) override;
+ void GetTilt(const GetPTZCompleteCallback& callback) override;
+ void GetZoom(const GetPTZCompleteCallback& callback) override;
+ void SetPan(int value, const SetPTZCompleteCallback& callback) override;
+ void SetTilt(int value, const SetPTZCompleteCallback& callback) override;
+ void SetZoom(int value, const SetPTZCompleteCallback& callback) override;
+ void SetPanDirection(PanDirection direction,
+ const SetPTZCompleteCallback& callback) override;
+ void SetTiltDirection(TiltDirection direction,
+ const SetPTZCompleteCallback& callback) override;
+ void Reset(bool pan,
+ bool tilt,
+ bool zoom,
+ const SetPTZCompleteCallback& callback) override;
const std::string path_;
const std::string extension_id_;
« no previous file with comments | « extensions/browser/api/webcam_private/v4l2_webcam.cc ('k') | extensions/browser/api/webcam_private/visca_webcam.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698