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

Side by Side Diff: ui/events/gesture_curve.h

Issue 2767213003: First Implementation of Snapped Points
Patch Set: Rebase and format Created 3 years, 6 months 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_EVENTS_GESTURE_CURVE_H_ 5 #ifndef UI_EVENTS_GESTURE_CURVE_H_
6 #define UI_EVENTS_GESTURE_CURVE_H_ 6 #define UI_EVENTS_GESTURE_CURVE_H_
7 7
8 #include "base/time/time.h" 8 #include "base/time/time.h"
9 #include "ui/gfx/geometry/vector2d_f.h" 9 #include "ui/gfx/geometry/vector2d_f.h"
10 10
11 namespace ui { 11 namespace ui {
12 12
13 // An abstraction of curve-based gesture motion, allowing platform-specific 13 // An abstraction of curve-based gesture motion, allowing platform-specific
14 // motion tailoring. 14 // motion tailoring.
15 class EVENTS_BASE_EXPORT GestureCurve { 15 class EVENTS_BASE_EXPORT GestureCurve {
16 public: 16 public:
17 virtual ~GestureCurve() {} 17 virtual ~GestureCurve() {}
18 18
19 // The output |offset| represents the total movement of the curve from its 19 // The output |offset| represents the total movement of the curve from its
20 // start until |time|. 20 // start until |time|.
21 // The output |velocity| represents the instantenous velocity at |time|. 21 // The output |velocity| represents the instantenous velocity at |time|.
22 // Returns false if |time| exceeds the fling duration, in which case 22 // Returns false if |time| exceeds the fling duration, in which case
23 // the terminal offset will be reported. 23 // the terminal offset will be reported.
24 virtual bool ComputeScrollOffset(base::TimeTicks time, 24 virtual bool ComputeScrollOffset(base::TimeTicks time,
25 gfx::Vector2dF* offset, 25 gfx::Vector2dF* offset,
26 gfx::Vector2dF* velocity) = 0; 26 gfx::Vector2dF* velocity) = 0;
27
28 virtual void ComputeTotalScrollOffset(gfx::Vector2dF& offset) = 0;
29
30 virtual bool ResetCurveBySnappedOffset(const gfx::Vector2dF& offset) = 0;
27 }; 31 };
28 32
29 } // namespace ui 33 } // namespace ui
30 34
31 #endif // UI_EVENTS_GESTURE_CURVE_H_ 35 #endif // UI_EVENTS_GESTURE_CURVE_H_
OLDNEW
« no previous file with comments | « ui/events/blink/input_handler_proxy.cc ('k') | ui/events/gestures/blink/web_gesture_curve_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698