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

Unified 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 win 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/child/touch_fling_gesture_curve_unittest.cc ('k') | content/child/web_gesture_curve_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/web_gesture_curve_impl.h
diff --git a/content/child/web_gesture_curve_impl.h b/content/child/web_gesture_curve_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..cb0d0bfeef5622d9ceec617ad3fec299504eb9ed
--- /dev/null
+++ b/content/child/web_gesture_curve_impl.h
@@ -0,0 +1,53 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_CHILD_WEB_GESTURE_CURVE_IMPL_H_
+#define CONTENT_CHILD_WEB_GESTURE_CURVE_IMPL_H_
+
+#include "base/macros.h"
+#include "base/memory/scoped_ptr.h"
+#include "content/common/content_export.h"
+#include "third_party/WebKit/public/platform/WebGestureCurve.h"
+#include "ui/gfx/geometry/vector2d_f.h"
+
+namespace blink {
+class WebGestureCurveTarget;
+}
+
+namespace ui {
+class GestureCurve;
+}
+
+namespace content {
+
+class CONTENT_EXPORT WebGestureCurveImpl
+ : public NON_EXPORTED_BASE(blink::WebGestureCurve) {
+ public:
+ static scoped_ptr<blink::WebGestureCurve> CreateFromDefaultPlatformCurve(
+ const gfx::Vector2dF& initial_velocity,
+ const gfx::Vector2dF& initial_offset);
+ static scoped_ptr<blink::WebGestureCurve> CreateFrom(
+ scoped_ptr<ui::GestureCurve> curve,
+ const gfx::Vector2dF& initial_offset);
+
+ virtual ~WebGestureCurveImpl();
+
+ // WebGestureCurve implementation.
+ virtual bool apply(double time,
+ blink::WebGestureCurveTarget* target) override;
+
+ private:
+ WebGestureCurveImpl(scoped_ptr<ui::GestureCurve> curve,
+ const gfx::Vector2dF& initial_offset);
+
+ scoped_ptr<ui::GestureCurve> curve_;
+
+ gfx::Vector2dF last_offset_;
+
+ DISALLOW_COPY_AND_ASSIGN(WebGestureCurveImpl);
+};
+
+} // namespace content
+
+#endif // CONTENT_CHILD_WEB_GESTURE_CURVE_IMPL_H_
« no previous file with comments | « content/child/touch_fling_gesture_curve_unittest.cc ('k') | content/child/web_gesture_curve_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698