Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1851)

Unified Diff: webkit/child/fling_animator_impl_android.h

Issue 172933004: [Android] Port Scroller.java to C++ and use for fling animations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Code review Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/ui_unittests.gyp ('k') | webkit/child/fling_animator_impl_android.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/child/fling_animator_impl_android.h
diff --git a/webkit/child/fling_animator_impl_android.h b/webkit/child/fling_animator_impl_android.h
index c4703677874680940a0dffcb4e57975f1f1a02e9..04931dbeb8959f69a4e794e2ceeef8f18fd4f7fe 100644
--- a/webkit/child/fling_animator_impl_android.h
+++ b/webkit/child/fling_animator_impl_android.h
@@ -5,11 +5,11 @@
#ifndef WEBKIT_CHILD_FLING_ANIMATOR_IMPL_ANDROID_H_
#define WEBKIT_CHILD_FLING_ANIMATOR_IMPL_ANDROID_H_
-#include "base/android/scoped_java_ref.h"
+
#include "third_party/WebKit/public/platform/WebFloatPoint.h"
#include "third_party/WebKit/public/platform/WebGestureCurve.h"
#include "third_party/WebKit/public/platform/WebSize.h"
-#include "ui/gfx/point.h"
+#include "ui/gfx/android/scroller.h"
#include "ui/gfx/point_f.h"
#include "webkit/child/webkit_child_export.h"
@@ -17,6 +17,10 @@ namespace blink {
class WebGestureCurveTarget;
}
+namespace gfx {
+class Scroller;
jamesr 2014/02/22 00:17:41 don't need the forward decl now
+}
+
namespace webkit_glue {
class WEBKIT_CHILD_EXPORT FlingAnimatorImpl : public blink::WebGestureCurve {
@@ -28,31 +32,21 @@ class WEBKIT_CHILD_EXPORT FlingAnimatorImpl : public blink::WebGestureCurve {
const blink::WebFloatPoint& velocity,
const blink::WebSize&);
- virtual bool apply(double time,
- blink::WebGestureCurveTarget* target);
-
- static bool RegisterJni(JNIEnv*);
+ virtual bool apply(double time, blink::WebGestureCurveTarget* target);
private:
void StartFling(const gfx::PointF& velocity);
- // Returns true if the animation is not yet finished.
- bool UpdatePosition();
- gfx::Point GetCurrentPosition();
- float GetCurrentVelocity();
- virtual void CancelFling();
+ void CancelFling();
bool is_active_;
- // Java OverScroller instance and methods.
- base::android::ScopedJavaGlobalRef<jobject> java_scroller_;
+ gfx::Scroller scroller_;
- gfx::Point last_position_;
- gfx::PointF last_velocity_;
- double last_time_;
+ gfx::PointF last_position_;
DISALLOW_COPY_AND_ASSIGN(FlingAnimatorImpl);
};
-} // namespace webkit_glue
+} // namespace webkit_glue
-#endif // WEBKIT_CHILD_FLING_ANIMATOR_IMPL_ANDROID_H_
+#endif // WEBKIT_CHILD_FLING_ANIMATOR_IMPL_ANDROID_H_
« no previous file with comments | « ui/ui_unittests.gyp ('k') | webkit/child/fling_animator_impl_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698