Chromium Code Reviews| 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_MOVE_GESTURE_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_SMOOTH_MOVE_GESTURE_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_SMOOTH_MOVE_GESTURE_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_SMOOTH_MOVE_GESTURE_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/time/time.h" | 11 #include "base/time/time.h" |
| 12 #include "content/browser/renderer_host/input/synthetic_gesture.h" | 12 #include "content/browser/renderer_host/input/synthetic_gesture.h" |
| 13 #include "content/browser/renderer_host/input/synthetic_gesture_target.h" | 13 #include "content/browser/renderer_host/input/synthetic_gesture_target.h" |
| 14 #include "content/browser/renderer_host/input/synthetic_pointer.h" | 14 #include "content/browser/renderer_host/input/synthetic_pointer_driver.h" |
| 15 #include "content/common/content_export.h" | 15 #include "content/common/content_export.h" |
| 16 #include "content/common/input/synthetic_smooth_drag_gesture_params.h" | 16 #include "content/common/input/synthetic_smooth_drag_gesture_params.h" |
| 17 #include "content/common/input/synthetic_smooth_scroll_gesture_params.h" | 17 #include "content/common/input/synthetic_smooth_scroll_gesture_params.h" |
| 18 #include "third_party/WebKit/public/web/WebInputEvent.h" | 18 #include "third_party/WebKit/public/web/WebInputEvent.h" |
| 19 #include "ui/gfx/geometry/vector2d.h" | 19 #include "ui/gfx/geometry/vector2d.h" |
| 20 #include "ui/gfx/geometry/vector2d_f.h" | 20 #include "ui/gfx/geometry/vector2d_f.h" |
| 21 | 21 |
| 22 namespace content { | 22 namespace content { |
| 23 | 23 |
| 24 class CONTENT_EXPORT SyntheticSmoothMoveGestureParams { | 24 class CONTENT_EXPORT SyntheticSmoothMoveGestureParams { |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 73 const base::TimeTicks& timestamp, SyntheticGestureTarget* target); | 73 const base::TimeTicks& timestamp, SyntheticGestureTarget* target); |
| 74 | 74 |
| 75 void ForwardMouseWheelEvent(SyntheticGestureTarget* target, | 75 void ForwardMouseWheelEvent(SyntheticGestureTarget* target, |
| 76 const gfx::Vector2dF& delta, | 76 const gfx::Vector2dF& delta, |
| 77 const base::TimeTicks& timestamp) const; | 77 const base::TimeTicks& timestamp) const; |
| 78 | 78 |
| 79 void PressPoint(SyntheticGestureTarget* target, | 79 void PressPoint(SyntheticGestureTarget* target, |
| 80 const base::TimeTicks& timestamp); | 80 const base::TimeTicks& timestamp); |
| 81 void MovePoint(SyntheticGestureTarget* target, | 81 void MovePoint(SyntheticGestureTarget* target, |
| 82 const gfx::Vector2dF& delta, | 82 const gfx::Vector2dF& delta, |
| 83 const base::TimeTicks& timestamp); | 83 const base::TimeTicks& timestamp, |
| 84 int index = 0); | |
|
tdresser
2016/11/12 19:50:55
Should the default here be -1?
lanwei
2016/11/14 04:20:54
Done.
| |
| 84 void ReleasePoint(SyntheticGestureTarget* target, | 85 void ReleasePoint(SyntheticGestureTarget* target, |
| 85 const base::TimeTicks& timestamp); | 86 const base::TimeTicks& timestamp, |
| 87 int index = 0); | |
| 86 | 88 |
| 87 void AddTouchSlopToFirstDistance(SyntheticGestureTarget* target); | 89 void AddTouchSlopToFirstDistance(SyntheticGestureTarget* target); |
| 88 gfx::Vector2dF GetPositionDeltaAtTime(const base::TimeTicks& timestamp) const; | 90 gfx::Vector2dF GetPositionDeltaAtTime(const base::TimeTicks& timestamp) const; |
| 89 void ComputeNextMoveSegment(); | 91 void ComputeNextMoveSegment(); |
| 90 base::TimeTicks ClampTimestamp(const base::TimeTicks& timestamp) const; | 92 base::TimeTicks ClampTimestamp(const base::TimeTicks& timestamp) const; |
| 91 bool FinishedCurrentMoveSegment(const base::TimeTicks& timestamp) const; | 93 bool FinishedCurrentMoveSegment(const base::TimeTicks& timestamp) const; |
| 92 bool IsLastMoveSegment() const; | 94 bool IsLastMoveSegment() const; |
| 93 bool MoveIsNoOp() const; | 95 bool MoveIsNoOp() const; |
| 94 | 96 |
| 95 SyntheticSmoothMoveGestureParams params_; | 97 SyntheticSmoothMoveGestureParams params_; |
| 96 std::unique_ptr<SyntheticPointer> synthetic_pointer_; | 98 std::unique_ptr<SyntheticPointerDriver> synthetic_pointer_driver_; |
| 97 // Used for mouse input. | 99 // Used for mouse input. |
| 98 gfx::Vector2d current_move_segment_total_delta_discrete_; | 100 gfx::Vector2d current_move_segment_total_delta_discrete_; |
| 99 // Used for touch input. | 101 // Used for touch input. |
| 100 gfx::PointF current_move_segment_start_position_; | 102 gfx::PointF current_move_segment_start_position_; |
| 101 GestureState state_; | 103 GestureState state_; |
| 102 int current_move_segment_; | 104 int current_move_segment_; |
| 103 base::TimeTicks current_move_segment_start_time_; | 105 base::TimeTicks current_move_segment_start_time_; |
| 104 base::TimeTicks current_move_segment_stop_time_; | 106 base::TimeTicks current_move_segment_stop_time_; |
| 105 | 107 |
| 106 DISALLOW_COPY_AND_ASSIGN(SyntheticSmoothMoveGesture); | 108 DISALLOW_COPY_AND_ASSIGN(SyntheticSmoothMoveGesture); |
| 107 }; | 109 }; |
| 108 | 110 |
| 109 } // namespace content | 111 } // namespace content |
| 110 | 112 |
| 111 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_SMOOTH_MOVE_GESTURE_H_ | 113 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_SMOOTH_MOVE_GESTURE_H_ |
| OLD | NEW |