OLD | NEW |
(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_ |
OLD | NEW |