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 #ifndef CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_SMOOTH_SCROLL_GESTURE_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_SMOOTH_SCROLL_GESTURE_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_SMOOTH_SCROLL_GESTURE_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_SMOOTH_SCROLL_GESTURE_H_ |
7 | 7 |
8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
9 #include "content/browser/renderer_host/input/synthetic_gesture.h" | 9 #include "content/browser/renderer_host/input/synthetic_gesture.h" |
10 #include "content/browser/renderer_host/input/synthetic_gesture_target.h" | 10 #include "content/browser/renderer_host/input/synthetic_gesture_target.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 // gestures (i.e. when synthesizing touch events, the touch pointer is not | 21 // gestures (i.e. when synthesizing touch events, the touch pointer is not |
22 // lifted when changing scroll direction). | 22 // lifted when changing scroll direction). |
23 // If no distance is provided or the first one is 0, no touch events are | 23 // If no distance is provided or the first one is 0, no touch events are |
24 // generated. | 24 // generated. |
25 // When synthesizing touch events, the first distance is extended to compensate | 25 // When synthesizing touch events, the first distance is extended to compensate |
26 // for the touch slop. | 26 // for the touch slop. |
27 class CONTENT_EXPORT SyntheticSmoothScrollGesture : public SyntheticGesture { | 27 class CONTENT_EXPORT SyntheticSmoothScrollGesture : public SyntheticGesture { |
28 public: | 28 public: |
29 explicit SyntheticSmoothScrollGesture( | 29 explicit SyntheticSmoothScrollGesture( |
30 const SyntheticSmoothScrollGestureParams& params); | 30 const SyntheticSmoothScrollGestureParams& params); |
31 virtual ~SyntheticSmoothScrollGesture(); | 31 ~SyntheticSmoothScrollGesture() override; |
32 | 32 |
33 virtual SyntheticGesture::Result ForwardInputEvents( | 33 SyntheticGesture::Result ForwardInputEvents( |
34 const base::TimeTicks& timestamp, | 34 const base::TimeTicks& timestamp, |
35 SyntheticGestureTarget* target) override; | 35 SyntheticGestureTarget* target) override; |
36 | 36 |
37 private: | 37 private: |
38 enum GestureState { | 38 enum GestureState { |
39 SETUP, | 39 SETUP, |
40 STARTED, | 40 STARTED, |
41 MOVING, | 41 MOVING, |
42 STOPPING, | 42 STOPPING, |
43 DONE | 43 DONE |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 int current_scroll_segment_; | 82 int current_scroll_segment_; |
83 base::TimeTicks current_scroll_segment_start_time_; | 83 base::TimeTicks current_scroll_segment_start_time_; |
84 base::TimeTicks current_scroll_segment_stop_time_; | 84 base::TimeTicks current_scroll_segment_stop_time_; |
85 | 85 |
86 DISALLOW_COPY_AND_ASSIGN(SyntheticSmoothScrollGesture); | 86 DISALLOW_COPY_AND_ASSIGN(SyntheticSmoothScrollGesture); |
87 }; | 87 }; |
88 | 88 |
89 } // namespace content | 89 } // namespace content |
90 | 90 |
91 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_SMOOTH_SCROLL_GESTURE_H
_ | 91 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_SMOOTH_SCROLL_GESTURE_H
_ |
OLD | NEW |