| 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 6ff1983d7139c16be4b7604726a8c80db40dea7f..1522746a3a1133057a110da432b1115f2270cd5f 100644
|
| --- a/ui/events/blink/input_handler_proxy.cc
|
| +++ b/ui/events/blink/input_handler_proxy.cc
|
| @@ -925,6 +925,9 @@ InputHandlerProxy::EventDisposition InputHandlerProxy::HandleGestureScrollEnd(
|
| DCHECK(expect_scroll_update_end_);
|
| expect_scroll_update_end_ = false;
|
| #endif
|
| + input_handler_->SnapAfterGestureScroll(
|
| + gfx::Point(gesture_event.x, gesture_event.y));
|
| +
|
| if (ShouldAnimate(gesture_event.data.scroll_end.delta_units !=
|
| blink::WebGestureEvent::ScrollUnits::kPixels)) {
|
| // Do nothing if the scroll is being animated; the scroll animation will
|
| @@ -933,6 +936,7 @@ InputHandlerProxy::EventDisposition InputHandlerProxy::HandleGestureScrollEnd(
|
| cc::ScrollState scroll_state = CreateScrollStateForGesture(gesture_event);
|
| input_handler_->ScrollEnd(&scroll_state);
|
| }
|
| +
|
| if (!gesture_scroll_on_impl_thread_)
|
| return DID_NOT_HANDLE;
|
|
|
| @@ -1009,7 +1013,10 @@ InputHandlerProxy::EventDisposition InputHandlerProxy::HandleGestureFlingStart(
|
| WebPoint(gesture_event.global_x, gesture_event.global_y);
|
| fling_parameters_.modifiers = gesture_event.GetModifiers();
|
| fling_parameters_.source_device = gesture_event.source_device;
|
| - RequestAnimation();
|
| + if (AdjustFlingCurveToSnapPoints())
|
| + RequestAnimation();
|
| + else
|
| + fling_curve_.reset();
|
| return DID_HANDLE;
|
| }
|
| case cc::InputHandler::SCROLL_UNKNOWN:
|
| @@ -1291,6 +1298,14 @@ void InputHandlerProxy::ExtendBoostedFlingTimeout(
|
| last_fling_boost_event_ = event;
|
| }
|
|
|
| +bool InputHandlerProxy::AdjustFlingCurveToSnapPoints() {
|
| + gfx::Vector2dF original_offset;
|
| + fling_curve_->ComputeTotalScrollOffset(original_offset);
|
| + gfx::Vector2dF snapped_offset;
|
| + input_handler_->FindSnappedOffset(&snapped_offset, original_offset);
|
| + return fling_curve_->ResetCurveBySnappedOffset(snapped_offset);
|
| +}
|
| +
|
| void InputHandlerProxy::Animate(base::TimeTicks time) {
|
| // If using synchronous animate, then only expect Animate attempts started by
|
| // the synchronous system. Don't let the InputHandler try to Animate also.
|
|
|