Index: content/browser/renderer_host/input/fling/fling_curve_impl_android.h |
diff --git a/content/browser/renderer_host/input/fling/fling_curve_impl_android.h b/content/browser/renderer_host/input/fling/fling_curve_impl_android.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..c63ae55fb0770325599f6233498f00db19424195 |
--- /dev/null |
+++ b/content/browser/renderer_host/input/fling/fling_curve_impl_android.h |
@@ -0,0 +1,49 @@ |
+// Copyright (c) 2013 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 CONTENT_BROWSER_RENDERER_HOST_INPUT_FLING_FLING_CURVE_IMPL_ANDROID_H_ |
+#define CONTENT_BROWSER_RENDERER_HOST_INPUT_FLING_FLING_CURVE_IMPL_ANDROID_H_ |
+ |
+#include "base/android/scoped_java_ref.h" |
+#include "content/browser/renderer_host/input/fling/fling_curve.h" |
+#include "content/common/content_export.h" |
+#include "ui/gfx/point.h" |
+#include "ui/gfx/point_f.h" |
+ |
+namespace content { |
+ |
+class CONTENT_EXPORT FlingCurveImplAndroid : public FlingCurve { |
+ public: |
+ FlingCurveImplAndroid(); |
+ virtual ~FlingCurveImplAndroid(); |
+ |
+ void StartFling(const gfx::PointF& velocity); |
+ |
+ // Overridden from FlingCurve. |
+ virtual bool Apply(double time_in_secs, FlingCurveTarget* target) OVERRIDE; |
+ |
+ static bool RegisterJni(JNIEnv*); |
+ |
+ private: |
+ // Returns true if the animation is not yet finished. |
+ bool UpdatePosition(); |
+ gfx::Point GetCurrentPosition(); |
+ float GetCurrentVelocity(); |
+ virtual void CancelFling(); |
+ |
+ bool is_active_; |
+ |
+ // Java OverScroller instance and methods. |
+ base::android::ScopedJavaGlobalRef<jobject> java_scroller_; |
+ |
+ gfx::Point last_position_; |
+ gfx::PointF last_velocity_; |
+ double last_time_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(FlingCurveImplAndroid); |
+}; |
+ |
+} // namespace content |
+ |
+#endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_FLING_FLING_CURVE_IMPL_ANDROID_H_ |