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

Unified Diff: content/browser/renderer_host/web_input_event_aura.cc

Issue 739013008: Explicitly suppress scrolling for wheel events that will trigger zooming (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Change comments Created 6 years 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/web_input_event_aura.cc
diff --git a/content/browser/renderer_host/web_input_event_aura.cc b/content/browser/renderer_host/web_input_event_aura.cc
index 4fe79c16dd1aae6893132ca789bc567c5449fa50..48679c5373ff5afc47da913edc25b9f6f839f855 100644
--- a/content/browser/renderer_host/web_input_event_aura.cc
+++ b/content/browser/renderer_host/web_input_event_aura.cc
@@ -197,6 +197,14 @@ blink::WebMouseWheelEvent MakeWebMouseWheelEvent(ui::MouseWheelEvent* event) {
webkit_event.globalX = root_point.x();
webkit_event.globalY = root_point.y();
+ // Scroll events generated from the mouse wheel when the control key is held
+ // don't trigger scrolling. Instead, they may cause zooming.
+ bool from_mouseWheel = !webkit_event.hasPreciseScrollingDeltas;
tdresser 2014/12/03 13:45:05 Sorry, I used the wrong formatting in my comment.
lanwei 2014/12/03 22:06:44 Done.
+ if ((webkit_event.modifiers & blink::WebInputEvent::ControlKey)
+ && from_mouseWheel) {
jdduke (slow) 2014/12/03 21:37:10 Nit: The && should be at the end of the preceding
lanwei 2014/12/03 22:06:44 Done. Yes, just realize they have different style
+ webkit_event.canScroll = false;
+ }
+
return webkit_event;
}
« no previous file with comments | « content/browser/renderer_host/input/input_router_impl.cc ('k') | content/browser/web_contents/web_contents_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698