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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 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_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_FLING_FLING_CURVE_H_
7
8 #include "content/common/content_export.h"
9 #include "third_party/WebKit/public/web/WebInputEvent.h"
10
11 namespace content {
12
13 class CONTENT_EXPORT FlingCurveTarget {
14 public:
15 virtual void ScrollBy(const gfx::PointF& delta) = 0;
16 virtual void NotifyCurrentFlingVelocity(const gfx::PointF& velocity) = 0;
17
18 protected:
19 virtual ~FlingCurveTarget() { }
20 };
21
22 // Abstract interface for curves used by Flinger. A FlingCurve defines the
23 // animation parameters as a function of time (zero-based), and applies the
24 // parameters directly to the target of the animation.
25 class CONTENT_EXPORT FlingCurve {
26 public:
27 virtual ~FlingCurve() {}
28
29 static FlingCurve* Create(blink::WebGestureEvent::SourceDevice source,
30 const gfx::PointF& velocity,
31 const gfx::Point& cumulative_scroll);
32
33 // Returns false if curve has finished and can no longer be applied.
34 virtual bool Apply(double time_in_secs, FlingCurveTarget*) = 0;
35 };
36
37 } // namespace content
38
39 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_FLING_FLING_CURVE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698