| 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_ANDROID_SCROLLER_H_ | 5 #ifndef UI_EVENTS_ANDROID_SCROLLER_H_ |
| 6 #define UI_EVENTS_ANDROID_SCROLLER_H_ | 6 #define UI_EVENTS_ANDROID_SCROLLER_H_ |
| 7 | 7 |
| 8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
| 9 #include "ui/events/events_base_export.h" | 9 #include "ui/events/events_base_export.h" |
| 10 #include "ui/events/gesture_curve.h" | 10 #include "ui/events/gesture_curve.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 Config(); | 21 Config(); |
| 22 | 22 |
| 23 // Controls fling deceleration. Defaults to 0.015f. | 23 // Controls fling deceleration. Defaults to 0.015f. |
| 24 float fling_friction; | 24 float fling_friction; |
| 25 | 25 |
| 26 // Controls fling accumulation. Defaults to disabled. | 26 // Controls fling accumulation. Defaults to disabled. |
| 27 bool flywheel_enabled; | 27 bool flywheel_enabled; |
| 28 }; | 28 }; |
| 29 | 29 |
| 30 explicit Scroller(const Config& config); | 30 explicit Scroller(const Config& config); |
| 31 virtual ~Scroller(); | 31 ~Scroller() override; |
| 32 | 32 |
| 33 // GestureCurve implementation. | 33 // GestureCurve implementation. |
| 34 virtual bool ComputeScrollOffset(base::TimeTicks time, | 34 bool ComputeScrollOffset(base::TimeTicks time, |
| 35 gfx::Vector2dF* offset, | 35 gfx::Vector2dF* offset, |
| 36 gfx::Vector2dF* velocity) override; | 36 gfx::Vector2dF* velocity) override; |
| 37 | 37 |
| 38 // Start scrolling by providing a starting point and the distance to travel. | 38 // Start scrolling by providing a starting point and the distance to travel. |
| 39 // The default value of 250 milliseconds will be used for the duration. | 39 // The default value of 250 milliseconds will be used for the duration. |
| 40 void StartScroll(float start_x, | 40 void StartScroll(float start_x, |
| 41 float start_y, | 41 float start_y, |
| 42 float dx, | 42 float dx, |
| 43 float dy, | 43 float dy, |
| 44 base::TimeTicks start_time); | 44 base::TimeTicks start_time); |
| 45 | 45 |
| 46 // Start scrolling by providing a starting point, the distance to travel, | 46 // Start scrolling by providing a starting point, the distance to travel, |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 float distance_; | 142 float distance_; |
| 143 | 143 |
| 144 float fling_friction_; | 144 float fling_friction_; |
| 145 float deceleration_; | 145 float deceleration_; |
| 146 float tuning_coeff_; | 146 float tuning_coeff_; |
| 147 }; | 147 }; |
| 148 | 148 |
| 149 } // namespace ui | 149 } // namespace ui |
| 150 | 150 |
| 151 #endif // UI_EVENTS_ANDROID_SCROLLER_H_ | 151 #endif // UI_EVENTS_ANDROID_SCROLLER_H_ |
| OLD | NEW |