| Index: content/browser/renderer_host/input/synthetic_smooth_move_gesture.cc
|
| diff --git a/content/browser/renderer_host/input/synthetic_smooth_move_gesture.cc b/content/browser/renderer_host/input/synthetic_smooth_move_gesture.cc
|
| index 26ad746f86b71b5d95f761f6ebe5e5cf2f5240dc..f626ecd99562fcfbb6459b848b761023e9bab71e 100644
|
| --- a/content/browser/renderer_host/input/synthetic_smooth_move_gesture.cc
|
| +++ b/content/browser/renderer_host/input/synthetic_smooth_move_gesture.cc
|
| @@ -38,7 +38,8 @@ const int kDefaultSpeedInPixelsPerSec = 800;
|
| } // namespace
|
|
|
| SyntheticSmoothMoveGestureParams::SyntheticSmoothMoveGestureParams()
|
| - : speed_in_pixels_s(kDefaultSpeedInPixelsPerSec),
|
| + : velocity(gfx::Vector2dF(0, 0)),
|
| + speed_in_pixels_s(kDefaultSpeedInPixelsPerSec),
|
| prevent_fling(true),
|
| add_slop(true) {}
|
|
|
| @@ -177,18 +178,21 @@ void SyntheticSmoothMoveGesture::ForwardMouseWheelInputEvents(
|
| if (!IsLastMoveSegment()) {
|
| current_move_segment_total_delta_discrete_ = gfx::Vector2d();
|
| ComputeNextMoveSegment();
|
| - ForwardMouseWheelInputEvents(timestamp, target);
|
| - } else {
|
| + } else if (params_.prevent_fling) {
|
| state_ = DONE;
|
| + } else {
|
| + state_ = STOPPING;
|
| }
|
| }
|
| } break;
|
| + case STOPPING: {
|
| + gfx::Vector2d velocity_discrete = FloorTowardZero(params_.velocity);
|
| + ForwardTouchpadFlingEvent(target, velocity_discrete, timestamp);
|
| + state_ = DONE;
|
| + } break;
|
| case SETUP:
|
| NOTREACHED() << "State SETUP invalid for synthetic scroll using mouse "
|
| "wheel input.";
|
| - case STOPPING:
|
| - NOTREACHED() << "State STOPPING invalid for synthetic scroll using mouse "
|
| - "wheel input.";
|
| case DONE:
|
| NOTREACHED()
|
| << "State DONE invalid for synthetic scroll using mouse wheel input.";
|
| @@ -253,6 +257,23 @@ void SyntheticSmoothMoveGesture::ForwardMouseWheelEvent(
|
| target->DispatchInputEventToPlatform(mouse_wheel_event);
|
| }
|
|
|
| +void SyntheticSmoothMoveGesture::ForwardTouchpadFlingEvent(
|
| + SyntheticGestureTarget* target,
|
| + const gfx::Vector2dF& velocity,
|
| + const base::TimeTicks& timestamp) const {
|
| + blink::WebGestureEvent fling_event =
|
| + SyntheticWebGestureEventBuilder::BuildFling(
|
| + velocity.x(), velocity.y(),
|
| + blink::WebGestureDevice::WebGestureDeviceTouchpad);
|
| +
|
| + fling_event.x = current_move_segment_start_position_.x();
|
| + fling_event.y = current_move_segment_start_position_.y();
|
| +
|
| + fling_event.setTimeStampSeconds(ConvertTimestampToSeconds(timestamp));
|
| +
|
| + target->DispatchInputEventToPlatform(fling_event);
|
| +}
|
| +
|
| void SyntheticSmoothMoveGesture::PressPoint(SyntheticGestureTarget* target,
|
| const base::TimeTicks& timestamp) {
|
| DCHECK_EQ(current_move_segment_, 0);
|
|
|