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

Unified Diff: content/browser/web_contents/web_contents_impl.cc

Issue 242733008: Prevent Control+two-finger-scroll from zooming the page. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: minor change Created 6 years, 8 months 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/web_contents/web_contents_impl.cc
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 2d05483deb87363c0809222b13b89c48845d2c72..bcff581bc7aaef7f2a5ae27e70442443d2b8b277 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -1223,7 +1223,10 @@ bool WebContentsImpl::HandleWheelEvent(
// with control key set which isn't what the user wants
if (delegate_ &&
event.wheelTicksY &&
- (event.modifiers & blink::WebInputEvent::ControlKey)) {
+ (event.modifiers & blink::WebInputEvent::ControlKey) &&
+ // Avoid adjusting the zoom in response to two-finger-scrolling touchpad
+ // gestures, which are regrettably easy to trigger accidentally.
+ !event.hasPreciseScrollingDeltas) {
delegate_->ContentsZoomChange(event.wheelTicksY > 0);
return true;
}

Powered by Google App Engine
This is Rietveld 408576698