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

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

Issue 112293004: Prevent ctrl+2f scroll on the touchpad to zoom the page (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_widget_host_view_aura.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
index 0c14ea8a20901581d3f620354c8ec0e87c26211b..4009334b031935775a3204bc2763c8f43b7ceb37 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -2865,6 +2865,16 @@ void RenderWidgetHostViewAura::OnScrollEvent(ui::ScrollEvent* event) {
host_->ForwardGestureEvent(gesture_event);
blink::WebMouseWheelEvent mouse_wheel_event =
MakeWebMouseWheelEvent(event);
+
+ // We don't want ctrl+two finger scroll to trigger the WebContents zooming
+ // function as it is too sensitive and most people don't expect the effect
+ // (unlike ctrl+mousewheel, which most people expect to zoom the page).
+ // Therefore, we clear the modifier here if and only if the ctrl key is
+ // pressed and no any other key is pressed at the same time. This prevents
+ // WebContentsImpl to zoom the page while retain the scroll event and other
Daniel Erat 2013/12/26 14:44:22 nit: s/to zoom/from zooming/, s/while retain/while
Shecky Lin 2013/12/27 03:23:54 Done.
+ // modifier combinations in case the webpage might want to use them.
+ if (mouse_wheel_event.modifiers == blink::WebInputEvent::ControlKey)
+ mouse_wheel_event.modifiers = 0;
host_->ForwardWheelEvent(mouse_wheel_event);
RecordAction(UserMetricsAction("TrackpadScroll"));
} else if (event->type() == ui::ET_SCROLL_FLING_START ||
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698