Revert of Roll src/third_party/WebKit e0eac24:489c548 (svn 193311:193320) (patchset...
[chromium-blink-merge.git] / ui / events / gesture_curve.h
blob7300e32fc9106d5f527b795355e007bd68159b65
1 // Copyright 2014 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.
5 #ifndef UI_EVENTS_GESTURE_CURVE_H_
6 #define UI_EVENTS_GESTURE_CURVE_H_
8 #include "base/time/time.h"
9 #include "ui/gfx/geometry/vector2d_f.h"
11 namespace ui {
13 // An abstraction of curve-based gesture motion, allowing platform-specific
14 // motion tailoring.
15 class EVENTS_BASE_EXPORT GestureCurve {
16 public:
17 virtual ~GestureCurve() {}
19 // The output |offset| represents the total movement of the curve from its
20 // start until |time|.
21 // The output |velocity| represents the instantenous velocity at |time|.
22 // Returns false if |time| exceeds the fling duration, in which case
23 // the terminal offset will be reported.
24 virtual bool ComputeScrollOffset(base::TimeTicks time,
25 gfx::Vector2dF* offset,
26 gfx::Vector2dF* velocity) = 0;
29 } // namespace ui
31 #endif // UI_EVENTS_GESTURE_CURVE_H_