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

Unified Diff: content/common/input/synthetic_smooth_drag_gesture_params.cc

Issue 929333002: Adding synthetic touch/mouse drag [Part1] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adderessed comments. Created 5 years, 10 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
Index: content/common/input/synthetic_smooth_drag_gesture_params.cc
diff --git a/content/common/input/synthetic_smooth_drag_gesture_params.cc b/content/common/input/synthetic_smooth_drag_gesture_params.cc
new file mode 100644
index 0000000000000000000000000000000000000000..f71364990d32e55378003ca7877b0c50b3728fe6
--- /dev/null
+++ b/content/common/input/synthetic_smooth_drag_gesture_params.cc
@@ -0,0 +1,43 @@
+// Copyright 2015 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.
+
+#include "content/common/input/synthetic_smooth_drag_gesture_params.h"
+
+#include "base/logging.h"
+
+namespace content {
+namespace {
+
+const int kDefaultSpeedInPixelsPerSec = 800;
+
+} // namespace
+
+SyntheticSmoothDragGestureParams::SyntheticSmoothDragGestureParams()
+ : speed_in_pixels_s(kDefaultSpeedInPixelsPerSec) {
+}
+
+SyntheticSmoothDragGestureParams::SyntheticSmoothDragGestureParams(
+ const SyntheticSmoothDragGestureParams& other)
+ : SyntheticGestureParams(other),
+ start_point(other.start_point),
+ distances(other.distances),
+ speed_in_pixels_s(other.speed_in_pixels_s) {
+}
+
+SyntheticSmoothDragGestureParams::~SyntheticSmoothDragGestureParams() {
+}
+
+SyntheticGestureParams::GestureType
+SyntheticSmoothDragGestureParams::GetGestureType() const {
+ return SMOOTH_DRAG_GESTURE;
+}
+
+const SyntheticSmoothDragGestureParams* SyntheticSmoothDragGestureParams::Cast(
+ const SyntheticGestureParams* gesture_params) {
+ DCHECK(gesture_params);
+ DCHECK_EQ(SMOOTH_DRAG_GESTURE, gesture_params->GetGestureType());
+ return static_cast<const SyntheticSmoothDragGestureParams*>(gesture_params);
+}
+
+} // namespace content

Powered by Google App Engine
This is Rietveld 408576698