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

Side by Side Diff: content/browser/renderer_host/input/fling/fling_curve_impl_android.h

Issue 45623005: [NOT FOR REVIEW] Patch demonstrating the changes required for browser side fling. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: patch Created 7 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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 // Overridden from FlingCurve.
22 virtual bool Apply(double time_in_secs, FlingCurveTarget* target) OVERRIDE;
23
24 static bool RegisterJni(JNIEnv*);
25
26 private:
27 void StartFling(const gfx::PointF& velocity);
28 // Returns true if the animation is not yet finished.
29 bool UpdatePosition();
30 gfx::Point GetCurrentPosition();
31 float GetCurrentVelocity();
32 virtual void CancelFling();
33
34 bool is_active_;
35
36 // Java OverScroller instance and methods.
37 base::android::ScopedJavaGlobalRef<jobject> java_scroller_;
38
39 gfx::Point last_position_;
40 gfx::PointF last_velocity_;
41 double last_time_;
42
43 DISALLOW_COPY_AND_ASSIGN(FlingCurveImplAndroid);
44 };
45
46 } // namespace content
47
48 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_FLING_FLING_CURVE_IMPL_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698