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

Unified Diff: content/browser/renderer_host/input/synthetic_gesture_target_aura.cc

Issue 2621353003: Replace mouse actions in pointer event tests with pointerActionSequence (Closed)
Patch Set: mouse test 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/browser/renderer_host/input/synthetic_gesture_target_aura.cc
diff --git a/content/browser/renderer_host/input/synthetic_gesture_target_aura.cc b/content/browser/renderer_host/input/synthetic_gesture_target_aura.cc
index 5715ca74661001f9094e47cf703b766cca449ba1..69919e60aad468eebb15348868d6a15cedcc8b1e 100644
--- a/content/browser/renderer_host/input/synthetic_gesture_target_aura.cc
+++ b/content/browser/renderer_host/input/synthetic_gesture_target_aura.cc
@@ -112,22 +112,17 @@ WebMouseEventTypeToEventType(blink::WebInputEvent::Type web_type) {
return ui::ET_UNKNOWN;
}
-int WebMouseEventButtonToFlags(blink::WebMouseEvent::Button button) {
- switch (button) {
- case blink::WebMouseEvent::Button::Left:
- return ui::EF_LEFT_MOUSE_BUTTON;
+int WebEventModifiersToEventFlags(int modifiers) {
+ int flags = 0;
- case blink::WebMouseEvent::Button::Middle:
- return ui::EF_MIDDLE_MOUSE_BUTTON;
+ if (modifiers & blink::WebInputEvent::LeftButtonDown)
+ flags |= ui::EF_LEFT_MOUSE_BUTTON;
+ if (modifiers & blink::WebInputEvent::MiddleButtonDown)
+ flags |= ui::EF_MIDDLE_MOUSE_BUTTON;
+ if (modifiers & blink::WebInputEvent::RightButtonDown)
+ flags |= ui::EF_RIGHT_MOUSE_BUTTON;
- case blink::WebMouseEvent::Button::Right:
- return ui::EF_RIGHT_MOUSE_BUTTON;
-
- default:
- NOTREACHED();
- }
-
- return 0;
+ return flags;
}
} // namespace
@@ -136,7 +131,7 @@ void SyntheticGestureTargetAura::DispatchWebMouseEventToPlatform(
const blink::WebMouseEvent& web_mouse,
const ui::LatencyInfo& latency_info) {
ui::EventType event_type = WebMouseEventTypeToEventType(web_mouse.type);
- int flags = WebMouseEventButtonToFlags(web_mouse.button);
+ int flags = WebEventModifiersToEventFlags(web_mouse.modifiers);
ui::MouseEvent mouse_event(event_type, gfx::Point(), gfx::Point(),
ui::EventTimeForNow(), flags, flags);
gfx::PointF location(web_mouse.x * device_scale_factor_,

Powered by Google App Engine
This is Rietveld 408576698