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

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

Issue 2359463002: Send the WebMouseWheelEvents unconverted if Shift is down. (Closed)
Patch Set: Fix test Created 4 years, 3 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 | ui/events/blink/web_input_event.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/input/mouse_wheel_event_queue.cc
diff --git a/content/browser/renderer_host/input/mouse_wheel_event_queue.cc b/content/browser/renderer_host/input/mouse_wheel_event_queue.cc
index 7579c2afb434748bf33817c802fbe61fbd5b2191..d206ce58dc8c40996b59db4a33aa3ffc1555e28b 100644
--- a/content/browser/renderer_host/input/mouse_wheel_event_queue.cc
+++ b/content/browser/renderer_host/input/mouse_wheel_event_queue.cc
@@ -99,10 +99,21 @@ void MouseWheelEventQueue::ProcessMouseWheelAck(
scroll_update.type = WebInputEvent::GestureScrollUpdate;
scroll_update.sourceDevice = blink::WebGestureDeviceTouchpad;
scroll_update.resendingPluginId = -1;
- scroll_update.data.scrollUpdate.deltaX =
- event_sent_for_gesture_ack_->event.deltaX;
- scroll_update.data.scrollUpdate.deltaY =
- event_sent_for_gesture_ack_->event.deltaY;
+
+ // Swap X&Y if Shift is down.
mustaq 2016/09/20 18:01:00 Nit: "X & Y"
dtapuska 2016/09/20 18:12:51 Done.
+ if ((event_sent_for_gesture_ack_->event.modifiers &
+ WebInputEvent::ShiftKey) != 0 &&
+ event_sent_for_gesture_ack_->event.deltaX == 0) {
mustaq 2016/09/20 18:01:00 I don't quite see the role of deltaX == 0 here. Co
dtapuska 2016/09/20 18:12:51 Shift only modifies vertical movement provided the
+ scroll_update.data.scrollUpdate.deltaX =
+ event_sent_for_gesture_ack_->event.deltaY;
+ scroll_update.data.scrollUpdate.deltaY =
+ event_sent_for_gesture_ack_->event.deltaX;
+ } else {
+ scroll_update.data.scrollUpdate.deltaX =
+ event_sent_for_gesture_ack_->event.deltaX;
+ scroll_update.data.scrollUpdate.deltaY =
+ event_sent_for_gesture_ack_->event.deltaY;
+ }
// Only OSX populates the phase and momentumPhase; so
// |inertialPhase| will be UnknownMomentumPhase on all other platforms.
if (event_sent_for_gesture_ack_->event.momentumPhase !=
« no previous file with comments | « no previous file | ui/events/blink/web_input_event.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698