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

Side by Side Diff: ui/events/gestures/fling_curve.h

Issue 436213002: athena: Add support for fling-scroll in overview mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 4 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 | Annotate | Revision Log
OLDNEW
(Empty)
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.
4
5 #ifndef UI_EVENTS_GESTURES_FLING_CURVE_H_
6 #define UI_EVENTS_GESTURES_FLING_CURVE_H_
7
8 #include "base/time/time.h"
9 #include "ui/events/events_base_export.h"
10 #include "ui/gfx/geometry/point_f.h"
11 #include "ui/gfx/geometry/vector2d_f.h"
12
13 namespace ui {
14
15 // FlingCurve can be used to scroll a UI element suitable for touch screen-based
16 // flings.
17 class EVENTS_BASE_EXPORT FlingCurve {
18 public:
19 FlingCurve(const gfx::Vector2dF& velocity, base::TimeTicks start_timestamp);
20 ~FlingCurve();
21
22 gfx::Vector2dF GetScrollAmountAtTime(base::TimeTicks current_timestamp);
23 base::TimeTicks start_timestamp() const { return start_timestamp_; }
24
25 private:
26 const float curve_duration_;
27 const base::TimeTicks start_timestamp_;
28
29 gfx::Vector2dF displacement_ratio_;
30 gfx::Vector2dF cumulative_scroll_;
31 base::TimeTicks last_timestamp_;
32 float time_offset_;
33 float position_offset_;
34
35 DISALLOW_COPY_AND_ASSIGN(FlingCurve);
36 };
37
38 } // namespace ui
39
40 #endif // UI_EVENTS_GESTURES_FLING_CURVE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698