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

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

Issue 835523006: Explicitly suppress scrolling for wheel events that will trigger zooming (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add DCHECK Created 5 years, 11 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 f9ba939d844ad18acc9ababcfad18f576437144e..1ca64d12589c3ef7c3add3cc1cd309e6f05e168f 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -1343,18 +1343,15 @@ void WebContentsImpl::HandleKeyboardEvent(const NativeWebKeyboardEvent& event) {
bool WebContentsImpl::HandleWheelEvent(
const blink::WebMouseWheelEvent& event) {
#if !defined(OS_MACOSX)
- // On platforms other than Mac, control+mousewheel changes zoom. On Mac, this
- // isn't done for two reasons:
+ // On platforms other than Mac, control+mousewheel may change zoom. On Mac,
+ // this isn't done for two reasons:
// -the OS already has a gesture to do this through pinch-zoom
// -if a user starts an inertial scroll, let's go, and presses control
// (i.e. control+tab) then the OS's buffered scroll events will come in
// with control key set which isn't what the user wants
- if (delegate_ &&
- event.wheelTicksY &&
+ if (delegate_ && event.wheelTicksY &&
(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) {
+ !event.canScroll) {
delegate_->ContentsZoomChange(event.wheelTicksY > 0);
return true;
}
« no previous file with comments | « content/browser/renderer_host/web_input_event_aura.cc ('k') | content/browser/web_contents/web_contents_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698