Removing flow to demote App Launcher to App Host, so app_host.exe can be deleted...
[chromium-blink-merge.git] / webkit / glue / touch_fling_platform_gesture_curve.h
blob8d01bdcff40d2fe6f96fb069255e1c4f4a3c4b1a
1 // Copyright (c) 2012 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 WEBKIT_GLUE_TOUCH_FLING_PLATFORM_GESTURE_CURVE_H_
6 #define WEBKIT_GLUE_TOUCH_FLING_PLATFORM_GESTURE_CURVE_H_
8 #include "third_party/WebKit/Source/Platform/chromium/public/WebFloatPoint.h"
9 #include "third_party/WebKit/Source/Platform/chromium/public/WebGestureCurve.h"
10 #include "third_party/WebKit/Source/Platform/chromium/public/WebSize.h"
11 #include "webkit/glue/webkit_glue_export.h"
13 namespace WebKit {
14 class WebGestureCurveTarget;
17 namespace webkit_glue {
19 // Implementation of WebGestureCurve suitable for touch pad/screen-based
20 // fling scroll. Starts with a flat velocity profile based on 'velocity', which
21 // tails off to zero. Time is scaled to that duration of the fling is
22 // proportional to the initial velocity.
23 class TouchFlingGestureCurve : public WebKit::WebGestureCurve {
24 public:
25 static WebGestureCurve* CreateForTouchPad(
26 const WebKit::WebFloatPoint& velocity,
27 const WebKit::WebSize& cumulativeScroll);
28 static WebGestureCurve* CreateForTouchScreen(
29 const WebKit::WebFloatPoint& velocity,
30 const WebKit::WebSize& cumulativeScroll);
31 WEBKIT_GLUE_EXPORT static WebGestureCurve* Create(
32 const WebKit::WebFloatPoint& initial_velocity,
33 float p0, float p1, float p2,
34 float curveDuration,
35 const WebKit::WebSize& cumulativeScroll);
37 virtual bool apply(double monotonicTime,
38 WebKit::WebGestureCurveTarget*) OVERRIDE;
40 private:
41 TouchFlingGestureCurve(const WebKit::WebFloatPoint& initial_velocity,
42 float p0,
43 float p1,
44 float p2,
45 float curve_duration,
46 const WebKit::WebSize& cumulativeScroll);
47 virtual ~TouchFlingGestureCurve();
49 WebKit::WebFloatPoint displacement_ratio_;
50 WebKit::WebSize cumulative_scroll_;
51 float coefficients_[3];
52 float time_offset_;
53 float curve_duration_;
54 float position_offset_;
56 DISALLOW_COPY_AND_ASSIGN(TouchFlingGestureCurve);
59 } // namespace webkit_glue
61 #endif // WEBKIT_GLUE_TOUCH_FLING_PLATFORM_GESTURE_CURVE_H_