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

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: Add comemnt 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..ad46286714c6ec8deaad77fc06d9c0e4f224e851 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 and when there is no horizontal movement.
+ if ((event_sent_for_gesture_ack_->event.modifiers &
+ WebInputEvent::ShiftKey) != 0 &&
+ event_sent_for_gesture_ack_->event.deltaX == 0) {
+ 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