OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 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 "content/common/input/synthetic_smooth_drag_gesture_params.h" |
| 6 |
| 7 #include "base/logging.h" |
| 8 |
| 9 namespace content { |
| 10 namespace { |
| 11 |
| 12 const int kDefaultSpeedInPixelsPerSec = 800; |
| 13 |
| 14 } // namespace |
| 15 |
| 16 SyntheticSmoothDragGestureParams::SyntheticSmoothDragGestureParams() |
| 17 : speed_in_pixels_s(kDefaultSpeedInPixelsPerSec) { |
| 18 } |
| 19 |
| 20 SyntheticSmoothDragGestureParams::SyntheticSmoothDragGestureParams( |
| 21 const SyntheticSmoothDragGestureParams& other) |
| 22 : SyntheticGestureParams(other), |
| 23 start_point(other.start_point), |
| 24 distances(other.distances), |
| 25 speed_in_pixels_s(other.speed_in_pixels_s) { |
| 26 } |
| 27 |
| 28 SyntheticSmoothDragGestureParams::~SyntheticSmoothDragGestureParams() { |
| 29 } |
| 30 |
| 31 SyntheticGestureParams::GestureType |
| 32 SyntheticSmoothDragGestureParams::GetGestureType() const { |
| 33 return SMOOTH_DRAG_GESTURE; |
| 34 } |
| 35 |
| 36 const SyntheticSmoothDragGestureParams* SyntheticSmoothDragGestureParams::Cast( |
| 37 const SyntheticGestureParams* gesture_params) { |
| 38 DCHECK(gesture_params); |
| 39 DCHECK_EQ(SMOOTH_DRAG_GESTURE, gesture_params->GetGestureType()); |
| 40 return static_cast<const SyntheticSmoothDragGestureParams*>(gesture_params); |
| 41 } |
| 42 |
| 43 } // namespace content |
OLD | NEW |