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

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: Fix the comment 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..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 ||
« 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