OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/browser/renderer_host/input/synthetic_smooth_scroll_gesture.h" | 5 #include "content/browser/renderer_host/input/synthetic_smooth_scroll_gesture.h" |
6 | 6 |
7 namespace content { | 7 namespace content { |
8 | 8 |
9 SyntheticSmoothScrollGesture::SyntheticSmoothScrollGesture( | 9 SyntheticSmoothScrollGesture::SyntheticSmoothScrollGesture( |
10 const SyntheticSmoothScrollGestureParams& params) | 10 const SyntheticSmoothScrollGestureParams& params) |
(...skipping 26 matching lines...) Expand all Loading... |
37 SyntheticGestureParams::GestureSourceType gesture_type, | 37 SyntheticGestureParams::GestureSourceType gesture_type, |
38 SyntheticGestureTarget* target) { | 38 SyntheticGestureTarget* target) { |
39 if (gesture_type == SyntheticGestureParams::DEFAULT_INPUT) | 39 if (gesture_type == SyntheticGestureParams::DEFAULT_INPUT) |
40 gesture_type = target->GetDefaultSyntheticGestureSourceType(); | 40 gesture_type = target->GetDefaultSyntheticGestureSourceType(); |
41 | 41 |
42 if (gesture_type == SyntheticGestureParams::TOUCH_INPUT || | 42 if (gesture_type == SyntheticGestureParams::TOUCH_INPUT || |
43 gesture_type == SyntheticGestureParams::MOUSE_INPUT) { | 43 gesture_type == SyntheticGestureParams::MOUSE_INPUT) { |
44 SyntheticSmoothMoveGestureParams move_params; | 44 SyntheticSmoothMoveGestureParams move_params; |
45 move_params.start_point = params_.anchor; | 45 move_params.start_point = params_.anchor; |
46 move_params.distances = params_.distances; | 46 move_params.distances = params_.distances; |
| 47 move_params.velocity = params_.velocity; |
47 move_params.speed_in_pixels_s = params_.speed_in_pixels_s; | 48 move_params.speed_in_pixels_s = params_.speed_in_pixels_s; |
48 move_params.prevent_fling = params_.prevent_fling; | 49 move_params.prevent_fling = params_.prevent_fling; |
49 move_params.input_type = GetInputSourceType(gesture_type); | 50 move_params.input_type = GetInputSourceType(gesture_type); |
50 move_params.add_slop = true; | 51 move_params.add_slop = true; |
51 move_gesture_.reset(new SyntheticSmoothMoveGesture(move_params)); | 52 move_gesture_.reset(new SyntheticSmoothMoveGesture(move_params)); |
52 return true; | 53 return true; |
53 } | 54 } |
54 return false; | 55 return false; |
55 } | 56 } |
56 | 57 |
57 } // namespace content | 58 } // namespace content |
OLD | NEW |