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

Unified Diff: content/common/input/synthetic_pointer_action_params.h

Issue 2634183002: Support multi-button press for synthetic mouse events (Closed)
Patch Set: Test modifiers and button Created 3 years, 11 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: content/common/input/synthetic_pointer_action_params.h
diff --git a/content/common/input/synthetic_pointer_action_params.h b/content/common/input/synthetic_pointer_action_params.h
index 6b4e74c358f30a47118e3e086a83f25e61d3261b..173fa4069789702f687dc005cb26a75afb29de67 100644
--- a/content/common/input/synthetic_pointer_action_params.h
+++ b/content/common/input/synthetic_pointer_action_params.h
@@ -51,6 +51,14 @@ struct CONTENT_EXPORT SyntheticPointerActionParams {
position_ = position;
}
+ void set_button(int button) {
+ DCHECK(pointer_action_type_ == PointerActionType::PRESS ||
+ pointer_action_type_ == PointerActionType::RELEASE);
+ DCHECK_GE(button, 0);
+ DCHECK_LE(button, 2);
+ button_ = button;
+ }
+
PointerActionType pointer_action_type() const { return pointer_action_type_; }
int index() const {
@@ -65,6 +73,14 @@ struct CONTENT_EXPORT SyntheticPointerActionParams {
return position_;
}
+ int button() const {
+ DCHECK(pointer_action_type_ == PointerActionType::PRESS ||
+ pointer_action_type_ == PointerActionType::RELEASE);
+ DCHECK_GE(button_, 0);
+ DCHECK_LE(button_, 2);
+ return button_;
+ }
+
private:
friend struct IPC::ParamTraits<content::SyntheticPointerActionParams>;
friend struct ipc_fuzzer::FuzzTraits<content::SyntheticPointerActionParams>;
@@ -75,6 +91,7 @@ struct CONTENT_EXPORT SyntheticPointerActionParams {
// The index of the pointer in the pointer action sequence passed from the
// user API.
int index_;
+ int button_;
};
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698