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

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

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
« no previous file with comments | « no previous file | content/browser/renderer_host/input/synthetic_mouse_driver.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 16a0f5e3dbb9b5579be968d836f43fbe6866c6d5..d08f69069270a214356c1b253ec036c5f1c0e857 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_,
« no previous file with comments | « no previous file | content/browser/renderer_host/input/synthetic_mouse_driver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698