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

Side by Side Diff: webkit/child/fling_curve_configuration.cc

Issue 52663003: Remove all fling related stuff from the renderer assuming that browser side Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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
« no previous file with comments | « webkit/child/fling_curve_configuration.h ('k') | webkit/child/touch_fling_gesture_curve.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2013 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 #include "webkit/child/fling_curve_configuration.h"
6
7 #include "base/logging.h"
8 #include "third_party/WebKit/public/platform/WebGestureCurve.h"
9 #include "webkit/child/touch_fling_gesture_curve.h"
10
11 namespace webkit_glue {
12
13 FlingCurveConfiguration::FlingCurveConfiguration() { }
14
15 FlingCurveConfiguration::~FlingCurveConfiguration() { }
16
17 void FlingCurveConfiguration::SetCurveParameters(
18 const std::vector<float>& new_touchpad,
19 const std::vector<float>& new_touchscreen) {
20 DCHECK(new_touchpad.size() >= 3);
21 DCHECK(new_touchscreen.size() >= 3);
22 base::AutoLock scoped_lock(lock_);
23 touchpad_coefs_ = new_touchpad;
24 touchscreen_coefs_ = new_touchscreen;
25 }
26
27 WebKit::WebGestureCurve* FlingCurveConfiguration::CreateCore(
28 const std::vector<float>& coefs,
29 const WebKit::WebFloatPoint& velocity,
30 const WebKit::WebSize& cumulativeScroll) {
31 float p0, p1, p2;
32
33 {
34 base::AutoLock scoped_lock(lock_);
35 p0 = coefs[0];
36 p1 = coefs[1];
37 p2 = coefs[2];
38 }
39
40 return TouchFlingGestureCurve::Create(velocity, p0, p1, p2, cumulativeScroll);
41 }
42
43 WebKit::WebGestureCurve* FlingCurveConfiguration::CreateForTouchPad(
44 const WebKit::WebFloatPoint& velocity,
45 const WebKit::WebSize& cumulativeScroll) {
46 return CreateCore(touchpad_coefs_, velocity, cumulativeScroll);
47 }
48
49 WebKit::WebGestureCurve* FlingCurveConfiguration::CreateForTouchScreen(
50 const WebKit::WebFloatPoint& velocity,
51 const WebKit::WebSize& cumulativeScroll) {
52 return CreateCore(touchscreen_coefs_, velocity, cumulativeScroll);
53 }
54
55 } // namespace webkit_glue
OLDNEW
« no previous file with comments | « webkit/child/fling_curve_configuration.h ('k') | webkit/child/touch_fling_gesture_curve.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698