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

Unified Diff: webkit/glue/fling_animator_impl_android.h

Issue 10823239: Upstream android's fling animator. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 8 years, 4 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 | « no previous file | webkit/glue/fling_animator_impl_android.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/fling_animator_impl_android.h
===================================================================
--- webkit/glue/fling_animator_impl_android.h (revision 0)
+++ webkit/glue/fling_animator_impl_android.h (working copy)
@@ -0,0 +1,44 @@
+// Copyright (c) 2012 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 WEBKIT_GLUE_FLING_ANIMATOR_IMPL_ANDROID_H_
+#define WEBKIT_GLUE_FLING_ANIMATOR_IMPL_ANDROID_H_
+
+#include "base/android/scoped_java_ref.h"
+#include "third_party/WebKit/Source/Platform/chromium/public/WebFlingAnimator.h"
+#include "third_party/WebKit/Source/Platform/chromium/public/WebFloatPoint.h"
+#include "third_party/WebKit/Source/Platform/chromium/public/WebPoint.h"
+#include "third_party/WebKit/Source/Platform/chromium/public/WebRect.h"
+
+namespace webkit_glue {
+
+class FlingAnimatorImpl : public WebKit::WebFlingAnimator {
+ public:
+ FlingAnimatorImpl();
+ virtual ~FlingAnimatorImpl();
+
+ virtual void startFling(const WebKit::WebFloatPoint& velocity,
+ const WebKit::WebRect& range);
+ // Returns true if the animation is not yet finished.
+ virtual bool updatePosition();
+ virtual WebKit::WebPoint getCurrentPosition();
+ virtual void cancelFling();
+
+ private:
+ bool is_active_;
+
+ // Java OverScroller instance and methods.
+ base::android::ScopedJavaGlobalRef<jobject> java_scroller_;
+ jmethodID fling_method_id_;
+ jmethodID abort_method_id_;
+ jmethodID compute_method_id_;
+ jmethodID getX_method_id_;
+ jmethodID getY_method_id_;
+
+ DISALLOW_COPY_AND_ASSIGN(FlingAnimatorImpl);
+};
+
+} // namespace webkit_glue
+
+#endif // WEBKIT_GLUE_FLING_ANIMATOR_IMPL_ANDROID_H_
« no previous file with comments | « no previous file | webkit/glue/fling_animator_impl_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698