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

Unified Diff: content/browser/renderer_host/input/fling/fling_curve.h

Issue 41703006: Move fling implementation from renderer to browser: (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 side-by-side diff with in-line comments
Download patch
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_

Powered by Google App Engine
This is Rietveld 408576698