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

Unified Diff: content/browser/renderer_host/input/input_router_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
« no previous file with comments | « no previous file | content/browser/renderer_host/input/input_router_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/input/input_router_impl.cc
diff --git a/content/browser/renderer_host/input/input_router_impl.cc b/content/browser/renderer_host/input/input_router_impl.cc
index 603adb05821f9e645bbaa97ea9682fc6bf450afc..f630846624d3b59c7155dcb6e373b24f0eae1a0a 100644
--- a/content/browser/renderer_host/input/input_router_impl.cc
+++ b/content/browser/renderer_host/input/input_router_impl.cc
@@ -136,11 +136,17 @@ void InputRouterImpl::SendWheelEvent(const QueuedWheelEvent& wheel_event) {
// dropping the old event, as for mouse moves) results in very slow
// scrolling on the Mac (on which many, very small wheel events are sent).
// Note that we can't coalesce wheel events for pinches because the GEQ
- // expects one ACK for each (but it's fine to coalesce non-pinch wheels
- // into a pinch one). Note that the GestureEventQueue ensures we only
- // ever have a single pinch event queued here.
+ // expects one ACK for each. But such events always have canScroll==false
+ // and hasPreciseDeltas=true, which should never happen for a real wheel
+ // event and so coalescing shouldn't occur. Note that the
+ // GestureEventQueue ensures we only ever have a single pinch event queued
+ // here.
+ DCHECK((wheel_event.event.event.hasPreciseScrollingDeltas &&
+ !wheel_event.event.event.canScroll) ==
+ wheel_event.synthesized_from_pinch);
if (coalesced_mouse_wheel_events_.empty() ||
- wheel_event.synthesized_from_pinch ||
+ wheel_event.synthesized_from_pinch !=
+ coalesced_mouse_wheel_events_.back().synthesized_from_pinch ||
!coalesced_mouse_wheel_events_.back().event.CanCoalesceWith(
wheel_event.event)) {
coalesced_mouse_wheel_events_.push_back(wheel_event);
@@ -455,7 +461,7 @@ void InputRouterImpl::SendSyntheticWheelEventForPinch(
wheelEvent.wheelTicksX = 0;
wheelEvent.wheelTicksY =
pinch_event.event.data.pinchUpdate.scale > 1 ? 1 : -1;
-
+ wheelEvent.canScroll = false;
SendWheelEvent(QueuedWheelEvent(
MouseWheelEventWithLatencyInfo(wheelEvent, pinch_event.latency), true));
}
« no previous file with comments | « no previous file | content/browser/renderer_host/input/input_router_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698