Chromium Code Reviews| 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 || |