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

Side by Side Diff: content/child/touch_fling_gesture_curve.h

Issue 586933003: fling: Remove a bunch of code for configuring fling curves. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: moar Created 6 years, 3 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
« no previous file with comments | « content/child/fling_curve_configuration.cc ('k') | content/child/touch_fling_gesture_curve.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 CONTENT_CHILD_TOUCH_FLING_GESTURE_CURVE_H_ 5 #ifndef CONTENT_CHILD_TOUCH_FLING_GESTURE_CURVE_H_
6 #define CONTENT_CHILD_TOUCH_FLING_GESTURE_CURVE_H_ 6 #define CONTENT_CHILD_TOUCH_FLING_GESTURE_CURVE_H_
7 7
8 #include "content/common/content_export.h" 8 #include "content/common/content_export.h"
9 #include "third_party/WebKit/public/platform/WebFloatPoint.h" 9 #include "third_party/WebKit/public/platform/WebFloatPoint.h"
10 #include "third_party/WebKit/public/platform/WebFloatSize.h" 10 #include "third_party/WebKit/public/platform/WebFloatSize.h"
11 #include "third_party/WebKit/public/platform/WebGestureCurve.h" 11 #include "third_party/WebKit/public/platform/WebGestureCurve.h"
12 #include "third_party/WebKit/public/platform/WebSize.h" 12 #include "third_party/WebKit/public/platform/WebSize.h"
13 13
14 namespace blink { 14 namespace blink {
15 class WebGestureCurveTarget; 15 class WebGestureCurveTarget;
16 } 16 }
17 17
18 namespace content { 18 namespace content {
19 19
20 // Implementation of WebGestureCurve suitable for touch pad/screen-based 20 // Implementation of WebGestureCurve suitable for touch pad/screen-based
21 // fling scroll. Starts with a flat velocity profile based on 'velocity', which 21 // fling scroll. Starts with a flat velocity profile based on 'velocity', which
22 // tails off to zero. Time is scaled to that duration of the fling is 22 // tails off to zero. Time is scaled to that duration of the fling is
23 // proportional to the initial velocity. 23 // proportional to the initial velocity.
24 class TouchFlingGestureCurve : public blink::WebGestureCurve { 24 class TouchFlingGestureCurve : public blink::WebGestureCurve {
25 public: 25 public:
26 26
27 static CONTENT_EXPORT WebGestureCurve* Create( 27 static CONTENT_EXPORT WebGestureCurve* Create(
28 const blink::WebFloatPoint& initial_velocity, 28 const blink::WebFloatPoint& initial_velocity,
29 float p0, float p1, float p2,
30 const blink::WebSize& cumulativeScroll); 29 const blink::WebSize& cumulativeScroll);
31 30
32 virtual bool apply(double monotonicTime, 31 virtual bool apply(double monotonicTime,
33 blink::WebGestureCurveTarget*) OVERRIDE; 32 blink::WebGestureCurveTarget*) OVERRIDE;
34 33
35 private: 34 private:
36 TouchFlingGestureCurve(const blink::WebFloatPoint& initial_velocity, 35 TouchFlingGestureCurve(const blink::WebFloatPoint& initial_velocity,
37 float p0,
38 float p1,
39 float p2,
40 const blink::WebSize& cumulativeScroll); 36 const blink::WebSize& cumulativeScroll);
41 virtual ~TouchFlingGestureCurve(); 37 virtual ~TouchFlingGestureCurve();
42 38
43 blink::WebFloatPoint displacement_ratio_; 39 blink::WebFloatPoint displacement_ratio_;
44 blink::WebFloatSize cumulative_scroll_; 40 blink::WebFloatSize cumulative_scroll_;
45 float coefficients_[3];
46 float time_offset_; 41 float time_offset_;
47 float curve_duration_; 42 float curve_duration_;
48 float position_offset_; 43 float position_offset_;
49 44
50 DISALLOW_COPY_AND_ASSIGN(TouchFlingGestureCurve); 45 DISALLOW_COPY_AND_ASSIGN(TouchFlingGestureCurve);
51 }; 46 };
52 47
53 } // namespace content 48 } // namespace content
54 49
55 #endif // CONTENT_CHILD_TOUCH_FLING_GESTURE_CURVE_H_ 50 #endif // CONTENT_CHILD_TOUCH_FLING_GESTURE_CURVE_H_
OLDNEW
« no previous file with comments | « content/child/fling_curve_configuration.cc ('k') | content/child/touch_fling_gesture_curve.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698