Index: ui/events/fling_curve.h |
diff --git a/ui/events/fling_curve.h b/ui/events/fling_curve.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..a0079ad2788529237eec88af3ccd745d54272c3f |
--- /dev/null |
+++ b/ui/events/fling_curve.h |
@@ -0,0 +1,38 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef UI_EVENTS_FLING_CURVE_H_ |
sky
2014/08/05 17:53:36
As this is gesture related would it make sense to
sadrul
2014/08/05 18:09:06
Yep. Done.
|
+#define UI_EVENTS_FLING_CURVE_H_ |
+ |
+#include "base/time/time.h" |
+#include "ui/events/events_base_export.h" |
+#include "ui/gfx/geometry/point_f.h" |
+#include "ui/gfx/geometry/vector2d_f.h" |
+ |
+namespace ui { |
+ |
+class EVENTS_BASE_EXPORT FlingCurve { |
sky
2014/08/05 17:53:36
Add a description.
sadrul
2014/08/05 18:09:06
Done.
|
+ public: |
+ FlingCurve(const gfx::Vector2dF& velocity, base::TimeTicks start_timestamp); |
+ ~FlingCurve(); |
+ |
+ gfx::Vector2dF GetScrollAmountAtTime(base::TimeTicks current_timestamp); |
+ base::TimeTicks creation_time() const { return start_timestamp_; } |
sky
2014/08/05 17:53:37
nit: style guide says getter and field should matc
sadrul
2014/08/05 18:09:06
Done (changed to start_timestamp()).
|
+ |
+ private: |
+ const float curve_duration_; |
+ |
+ gfx::Vector2dF displacement_ratio_; |
+ gfx::Vector2dF cumulative_scroll_; |
+ base::TimeTicks start_timestamp_; |
sky
2014/08/05 17:53:37
const?
sadrul
2014/08/05 18:09:06
Done.
|
+ base::TimeTicks last_timestamp_; |
+ float time_offset_; |
+ float position_offset_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(FlingCurve); |
+}; |
+ |
+} // namespace ui |
+ |
+#endif // UI_EVENTS_FLING_CURVE_H_ |