OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_INPUT_FLING_FLING_CURVE_IMPL_ANDROID_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_FLING_FLING_CURVE_IMPL_ANDROID_H_ |
| 7 |
| 8 #include "base/android/scoped_java_ref.h" |
| 9 #include "content/browser/renderer_host/input/fling/fling_curve.h" |
| 10 #include "content/common/content_export.h" |
| 11 #include "ui/gfx/point.h" |
| 12 #include "ui/gfx/point_f.h" |
| 13 |
| 14 namespace content { |
| 15 |
| 16 class CONTENT_EXPORT FlingCurveImplAndroid : public FlingCurve { |
| 17 public: |
| 18 FlingCurveImplAndroid(); |
| 19 virtual ~FlingCurveImplAndroid(); |
| 20 |
| 21 void StartFling(const gfx::PointF& velocity); |
| 22 |
| 23 // Overridden from FlingCurve. |
| 24 virtual bool Apply(double time_in_secs, FlingCurveTarget* target) OVERRIDE; |
| 25 |
| 26 static bool RegisterJni(JNIEnv*); |
| 27 |
| 28 private: |
| 29 // Returns true if the animation is not yet finished. |
| 30 bool UpdatePosition(); |
| 31 gfx::Point GetCurrentPosition(); |
| 32 float GetCurrentVelocity(); |
| 33 virtual void CancelFling(); |
| 34 |
| 35 bool is_active_; |
| 36 |
| 37 // Java OverScroller instance and methods. |
| 38 base::android::ScopedJavaGlobalRef<jobject> java_scroller_; |
| 39 |
| 40 gfx::Point last_position_; |
| 41 gfx::PointF last_velocity_; |
| 42 double last_time_; |
| 43 |
| 44 DISALLOW_COPY_AND_ASSIGN(FlingCurveImplAndroid); |
| 45 }; |
| 46 |
| 47 } // namespace content |
| 48 |
| 49 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_FLING_FLING_CURVE_IMPL_ANDROID_H_ |
OLD | NEW |