OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 UI_EVENTS_GESTURES_BLINK_WEB_GESTURE_CURVE_IMPL_H_ | 5 #ifndef UI_EVENTS_GESTURES_BLINK_WEB_GESTURE_CURVE_IMPL_H_ |
6 #define UI_EVENTS_GESTURES_BLINK_WEB_GESTURE_CURVE_IMPL_H_ | 6 #define UI_EVENTS_GESTURES_BLINK_WEB_GESTURE_CURVE_IMPL_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/time/time.h" |
10 #include "third_party/WebKit/public/platform/WebGestureCurve.h" | 11 #include "third_party/WebKit/public/platform/WebGestureCurve.h" |
11 #include "ui/gfx/geometry/vector2d_f.h" | 12 #include "ui/gfx/geometry/vector2d_f.h" |
12 | 13 |
13 namespace blink { | 14 namespace blink { |
14 class WebGestureCurveTarget; | 15 class WebGestureCurveTarget; |
15 } | 16 } |
16 | 17 |
17 namespace ui { | 18 namespace ui { |
18 class GestureCurve; | 19 class GestureCurve; |
19 | 20 |
20 class WebGestureCurveImpl : public NON_EXPORTED_BASE(blink::WebGestureCurve) { | 21 class WebGestureCurveImpl : public NON_EXPORTED_BASE(blink::WebGestureCurve) { |
21 public: | 22 public: |
22 static scoped_ptr<blink::WebGestureCurve> CreateFromDefaultPlatformCurve( | 23 static scoped_ptr<blink::WebGestureCurve> CreateFromDefaultPlatformCurve( |
23 const gfx::Vector2dF& initial_velocity, | 24 const gfx::Vector2dF& initial_velocity, |
24 const gfx::Vector2dF& initial_offset, | 25 const gfx::Vector2dF& initial_offset, |
25 bool on_main_thread); | 26 bool on_main_thread); |
| 27 |
| 28 static scoped_ptr<WebGestureCurve> CreateFromSmoothScrollingCurve( |
| 29 float start_x, |
| 30 float start_y, |
| 31 float dx, |
| 32 float dy, |
| 33 base::TimeDelta duration, |
| 34 bool on_main_thread); |
| 35 |
26 static scoped_ptr<blink::WebGestureCurve> CreateFromUICurveForTesting( | 36 static scoped_ptr<blink::WebGestureCurve> CreateFromUICurveForTesting( |
27 scoped_ptr<GestureCurve> curve, | 37 scoped_ptr<GestureCurve> curve, |
28 const gfx::Vector2dF& initial_offset); | 38 const gfx::Vector2dF& initial_offset); |
29 | 39 |
30 virtual ~WebGestureCurveImpl(); | 40 virtual ~WebGestureCurveImpl(); |
31 | 41 |
32 // WebGestureCurve implementation. | 42 // WebGestureCurve implementation. |
33 virtual bool apply(double time, | 43 virtual bool apply(double time, |
34 blink::WebGestureCurveTarget* target) override; | 44 blink::WebGestureCurveTarget* target) override; |
35 | 45 |
(...skipping 16 matching lines...) Expand all Loading... |
52 int64 ticks_since_first_animate_; | 62 int64 ticks_since_first_animate_; |
53 double first_animate_time_; | 63 double first_animate_time_; |
54 double last_animate_time_; | 64 double last_animate_time_; |
55 | 65 |
56 DISALLOW_COPY_AND_ASSIGN(WebGestureCurveImpl); | 66 DISALLOW_COPY_AND_ASSIGN(WebGestureCurveImpl); |
57 }; | 67 }; |
58 | 68 |
59 } // namespace ui | 69 } // namespace ui |
60 | 70 |
61 #endif // UI_EVENTS_GESTURES_BLINK_WEB_GESTURE_CURVE_IMPL_H_ | 71 #endif // UI_EVENTS_GESTURES_BLINK_WEB_GESTURE_CURVE_IMPL_H_ |
OLD | NEW |