Chromium Code Reviews| 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); |
|
dcheng
2017/01/17 23:42:19
Presumably, left/middle/right. Is it possible to m
lanwei
2017/01/18 04:24:43
Done.
|
| + 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 |