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

Unified Diff: ui/events/blink/input_handler_proxy.cc

Issue 2486673008: Touchpad scroll latching enabled for Mac behind flag. (Closed)
Patch Set: nit fixed: assignment instead of condition Created 4 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 | « content/browser/renderer_host/input/mouse_wheel_event_queue_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/blink/input_handler_proxy.cc
diff --git a/ui/events/blink/input_handler_proxy.cc b/ui/events/blink/input_handler_proxy.cc
index a4100162e2c0adec240cd4968f1069fa0aaabbb6..0bc9e4691ea706b2f23bd14e99489dcd11bec14b 100644
--- a/ui/events/blink/input_handler_proxy.cc
+++ b/ui/events/blink/input_handler_proxy.cc
@@ -140,6 +140,11 @@ cc::ScrollState CreateScrollStateForGesture(const WebGestureEvent& event) {
scroll_state_data.position_x = event.x;
scroll_state_data.position_y = event.y;
scroll_state_data.is_beginning = true;
+ // On Mac, a GestureScrollBegin in the inertial phase indicates a fling
+ // start.
+ scroll_state_data.is_in_inertial_phase =
+ (event.data.scrollBegin.inertialPhase ==
+ WebGestureEvent::MomentumPhase);
break;
case WebInputEvent::GestureFlingStart:
scroll_state_data.velocity_x = event.data.flingStart.velocityX;
@@ -788,6 +793,7 @@ InputHandlerProxy::HandleGestureScrollUpdate(
if (ShouldAnimate(gesture_event.data.scrollUpdate.deltaUnits !=
blink::WebGestureEvent::ScrollUnits::Pixels)) {
+ DCHECK(!scroll_state.is_in_inertial_phase());
base::TimeTicks event_time =
base::TimeTicks() +
base::TimeDelta::FromSecondsD(gesture_event.timeStampSeconds);
« no previous file with comments | « content/browser/renderer_host/input/mouse_wheel_event_queue_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698