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

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

Issue 2634183002: Support multi-button press for synthetic mouse events (Closed)
Patch Set: 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..ba0c2addd6ac6339d849ccf91e7be7a527e02ed4 100644
--- a/content/common/input/synthetic_pointer_action_params.h
+++ b/content/common/input/synthetic_pointer_action_params.h
@@ -9,6 +9,7 @@
#include "content/common/content_export.h"
#include "content/common/input/input_param_traits.h"
#include "content/common/input/synthetic_gesture_params.h"
+#include "content/common/input/synthetic_web_input_event_builders.h"
#include "ui/gfx/geometry/point_f.h"
namespace ipc_fuzzer {
@@ -31,6 +32,8 @@ struct CONTENT_EXPORT SyntheticPointerActionParams {
POINTER_ACTION_TYPE_MAX = IDLE
};
+ enum class Button { LEFT, MIDDLE, RIGHT, BUTTON_MAX = RIGHT };
+
SyntheticPointerActionParams();
SyntheticPointerActionParams(PointerActionType action_type);
~SyntheticPointerActionParams();
@@ -51,6 +54,12 @@ struct CONTENT_EXPORT SyntheticPointerActionParams {
position_ = position;
}
+ void set_button(Button button) {
+ DCHECK(pointer_action_type_ == PointerActionType::PRESS ||
+ pointer_action_type_ == PointerActionType::RELEASE);
+ button_ = button;
+ }
+
PointerActionType pointer_action_type() const { return pointer_action_type_; }
int index() const {
@@ -65,6 +74,17 @@ struct CONTENT_EXPORT SyntheticPointerActionParams {
return position_;
}
+ Button button() const {
+ DCHECK(pointer_action_type_ == PointerActionType::PRESS ||
+ pointer_action_type_ == PointerActionType::RELEASE);
+ return button_;
+ }
+
+ static unsigned GetWebMouseEventModifier(
+ SyntheticPointerActionParams::Button button);
+ static blink::WebMouseEvent::Button GetWebMouseEventButton(
+ SyntheticPointerActionParams::Button button);
+
private:
friend struct IPC::ParamTraits<content::SyntheticPointerActionParams>;
friend struct ipc_fuzzer::FuzzTraits<content::SyntheticPointerActionParams>;
@@ -75,6 +95,7 @@ struct CONTENT_EXPORT SyntheticPointerActionParams {
// The index of the pointer in the pointer action sequence passed from the
// user API.
int index_;
+ Button button_;
};
} // namespace content
« no previous file with comments | « content/browser/renderer_host/input/synthetic_touch_driver.cc ('k') | content/common/input/synthetic_pointer_action_params.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698