Index: content/browser/renderer_host/input/fling/fling_curve.h |
diff --git a/content/browser/renderer_host/input/fling/fling_curve.h b/content/browser/renderer_host/input/fling/fling_curve.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..f478884546b39366eaa9ef241b20e6af8db8d3f3 |
--- /dev/null |
+++ b/content/browser/renderer_host/input/fling/fling_curve.h |
@@ -0,0 +1,39 @@ |
+// Copyright 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_H_ |
+#define CONTENT_BROWSER_RENDERER_HOST_INPUT_FLING_FLING_CURVE_H_ |
+ |
+#include "content/common/content_export.h" |
+#include "third_party/WebKit/public/web/WebInputEvent.h" |
+ |
+namespace content { |
+ |
+class CONTENT_EXPORT FlingCurveTarget { |
+ public: |
+ virtual void ScrollBy(const gfx::PointF& delta) = 0; |
+ virtual void NotifyCurrentFlingVelocity(const gfx::PointF& velocity) = 0; |
+ |
+ protected: |
+ virtual ~FlingCurveTarget() { } |
+}; |
+ |
+// Abstract interface for curves used by Flinger. A FlingCurve defines the |
+// animation parameters as a function of time (zero-based), and applies the |
+// parameters directly to the target of the animation. |
+class CONTENT_EXPORT FlingCurve { |
+ public: |
+ virtual ~FlingCurve() {} |
+ |
+ static FlingCurve* Create(blink::WebGestureEvent::SourceDevice source, |
+ const gfx::PointF& velocity, |
+ const gfx::Point& cumulative_scroll); |
+ |
+ // Returns false if curve has finished and can no longer be applied. |
+ virtual bool Apply(double time_in_secs, FlingCurveTarget*) = 0; |
+}; |
+ |
+} // namespace content |
+ |
+#endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_FLING_FLING_CURVE_H_ |