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..cfe417396a422be653915a21312a9519b888401b 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,17 @@ 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 from zooming the page while retaining the scroll event |
| + // and other modifier combinations in case the webpage might want to use |
| + // them. |
| + if (mouse_wheel_event.modifiers == blink::WebInputEvent::ControlKey) |
| + mouse_wheel_event.modifiers = 0; |
|
sadrul
2014/01/03 18:09:17
If we want to disable this only on chromeos, then
Rick Byers
2014/04/04 17:35:53
I think it's fine to do this for ChromeOS only for
sadrul
2014/04/04 19:00:21
Note that shortly after this patchset, we started
|
| host_->ForwardWheelEvent(mouse_wheel_event); |
| RecordAction(UserMetricsAction("TrackpadScroll")); |
| } else if (event->type() == ui::ET_SCROLL_FLING_START || |