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

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

Issue 2486673008: Touchpad scroll latching enabled for Mac behind flag. (Closed)
Patch Set: merge conflicts resolved. Created 4 years, 1 month 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: 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 40d1415d9e9ec0a9493b194486da549f9aed5a8c..ab4be6cc7f98c84028d2c65c594a47dff8fba206 100644
--- a/ui/events/blink/input_handler_proxy.cc
+++ b/ui/events/blink/input_handler_proxy.cc
@@ -133,6 +133,12 @@ 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.
+ if (event.data.scrollBegin.inertialPhase ==
+ WebGestureEvent::MomentumPhase) {
+ scroll_state_data.is_in_inertial_phase = true;
+ }
break;
case WebInputEvent::GestureFlingStart:
scroll_state_data.velocity_x = event.data.flingStart.velocityX;
@@ -151,6 +157,8 @@ cc::ScrollState CreateScrollStateForGesture(const WebGestureEvent& event) {
case WebInputEvent::GestureScrollEnd:
case WebInputEvent::GestureFlingCancel:
scroll_state_data.is_ending = true;
+ scroll_state_data.may_precede_fling =
+ event.data.scrollEnd.mayPrecedeFling;
break;
default:
NOTREACHED();
@@ -688,6 +696,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);

Powered by Google App Engine
This is Rietveld 408576698