| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 bool on_main_thread); | 31 bool on_main_thread); |
| 32 static std::unique_ptr<blink::WebGestureCurve> CreateFromUICurveForTesting( | 32 static std::unique_ptr<blink::WebGestureCurve> CreateFromUICurveForTesting( |
| 33 std::unique_ptr<GestureCurve> curve, | 33 std::unique_ptr<GestureCurve> curve, |
| 34 const gfx::Vector2dF& initial_offset); | 34 const gfx::Vector2dF& initial_offset); |
| 35 | 35 |
| 36 ~WebGestureCurveImpl() override; | 36 ~WebGestureCurveImpl() override; |
| 37 | 37 |
| 38 // WebGestureCurve implementation. | 38 // WebGestureCurve implementation. |
| 39 bool Apply(double time, blink::WebGestureCurveTarget* target) override; | 39 bool Apply(double time, blink::WebGestureCurveTarget* target) override; |
| 40 | 40 |
| 41 void ComputeTotalScrollOffset(gfx::Vector2dF& offset) override; |
| 42 |
| 43 bool ResetCurveBySnappedOffset(const gfx::Vector2dF& offset) override; |
| 44 |
| 41 private: | 45 private: |
| 42 enum class ThreadType { | 46 enum class ThreadType { |
| 43 MAIN, | 47 MAIN, |
| 44 IMPL, | 48 IMPL, |
| 45 TEST | 49 TEST |
| 46 }; | 50 }; |
| 47 | 51 |
| 48 WebGestureCurveImpl(std::unique_ptr<GestureCurve> curve, | 52 WebGestureCurveImpl(std::unique_ptr<GestureCurve> curve, |
| 49 const gfx::Vector2dF& initial_offset, | 53 const gfx::Vector2dF& initial_offset, |
| 50 ThreadType animating_thread_type); | 54 ThreadType animating_thread_type); |
| 51 | 55 |
| 52 std::unique_ptr<GestureCurve> curve_; | 56 std::unique_ptr<GestureCurve> curve_; |
| 53 | 57 |
| 54 gfx::Vector2dF last_offset_; | 58 gfx::Vector2dF last_offset_; |
| 55 | 59 |
| 56 ThreadType animating_thread_type_; | 60 ThreadType animating_thread_type_; |
| 57 int64_t ticks_since_first_animate_; | 61 int64_t ticks_since_first_animate_; |
| 58 double first_animate_time_; | 62 double first_animate_time_; |
| 59 double last_animate_time_; | 63 double last_animate_time_; |
| 60 | 64 |
| 61 DISALLOW_COPY_AND_ASSIGN(WebGestureCurveImpl); | 65 DISALLOW_COPY_AND_ASSIGN(WebGestureCurveImpl); |
| 62 }; | 66 }; |
| 63 | 67 |
| 64 } // namespace ui | 68 } // namespace ui |
| 65 | 69 |
| 66 #endif // UI_EVENTS_GESTURES_BLINK_WEB_GESTURE_CURVE_IMPL_H_ | 70 #endif // UI_EVENTS_GESTURES_BLINK_WEB_GESTURE_CURVE_IMPL_H_ |
| OLD | NEW |