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

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

Issue 634373003: Consolidate content fling implementations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix GN build Created 6 years, 2 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
(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 CONTENT_CHILD_WEB_GESTURE_CURVE_IMPL_H_
6 #define CONTENT_CHILD_WEB_GESTURE_CURVE_IMPL_H_
7
8 #include "base/macros.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "content/common/content_export.h"
11 #include "third_party/WebKit/public/platform/WebGestureCurve.h"
12 #include "ui/gfx/geometry/vector2d_f.h"
13
14 namespace blink {
15 class WebGestureCurveTarget;
16 }
17
18 namespace ui {
19 class GestureCurve;
20 }
21
22 namespace content {
23
24 class CONTENT_EXPORT WebGestureCurveImpl : public blink::WebGestureCurve {
25 public:
26 static scoped_ptr<blink::WebGestureCurve> CreateFromDefaultPlatformCurve(
27 const gfx::Vector2dF& initial_velocity,
28 const gfx::Vector2dF& initial_offset);
29 static scoped_ptr<blink::WebGestureCurve> CreateFrom(
30 scoped_ptr<ui::GestureCurve> curve,
31 const gfx::Vector2dF& initial_offset);
32
33 virtual ~WebGestureCurveImpl();
34
35 // WebGestureCurve implementation.
36 virtual bool apply(double time,
37 blink::WebGestureCurveTarget* target) override;
38
39 private:
40 WebGestureCurveImpl(scoped_ptr<ui::GestureCurve> curve,
41 const gfx::Vector2dF& initial_offset);
42
43 scoped_ptr<ui::GestureCurve> curve_;
44
45 gfx::Vector2dF last_offset_;
46
47 DISALLOW_COPY_AND_ASSIGN(WebGestureCurveImpl);
48 };
49
50 } // namespace content
51
52 #endif // CONTENT_CHILD_WEB_GESTURE_CURVE_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698