| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/common/input/synthetic_smooth_scroll_gesture_params.h" | 5 #include "content/common/input/synthetic_smooth_scroll_gesture_params.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 | 8 |
| 9 namespace content { | 9 namespace content { |
| 10 namespace { | 10 namespace { |
| 11 | 11 |
| 12 const float kDefaultSpeedInPixelsS = 800; | 12 const float kDefaultSpeedInPixelsS = 800; |
| 13 | 13 |
| 14 } // namespace | 14 } // namespace |
| 15 | 15 |
| 16 SyntheticSmoothScrollGestureParams::SyntheticSmoothScrollGestureParams() | 16 SyntheticSmoothScrollGestureParams::SyntheticSmoothScrollGestureParams() |
| 17 : prevent_fling(true), speed_in_pixels_s(kDefaultSpeedInPixelsS) {} | 17 : prevent_fling(true), speed_in_pixels_s(kDefaultSpeedInPixelsS) {} |
| 18 | 18 |
| 19 SyntheticSmoothScrollGestureParams::SyntheticSmoothScrollGestureParams( | 19 SyntheticSmoothScrollGestureParams::SyntheticSmoothScrollGestureParams( |
| 20 const SyntheticSmoothScrollGestureParams& other) | 20 const SyntheticSmoothScrollGestureParams& other) |
| 21 : SyntheticGestureParams(other), | 21 : SyntheticGestureParams(other), |
| 22 anchor(other.anchor), | 22 anchor(other.anchor), |
| 23 distances(other.distances), | 23 distances(other.distances), |
| 24 velocity(other.velocity), |
| 24 prevent_fling(other.prevent_fling), | 25 prevent_fling(other.prevent_fling), |
| 25 speed_in_pixels_s(other.speed_in_pixels_s) {} | 26 speed_in_pixels_s(other.speed_in_pixels_s) {} |
| 26 | 27 |
| 27 SyntheticSmoothScrollGestureParams::~SyntheticSmoothScrollGestureParams() {} | 28 SyntheticSmoothScrollGestureParams::~SyntheticSmoothScrollGestureParams() {} |
| 28 | 29 |
| 29 SyntheticGestureParams::GestureType | 30 SyntheticGestureParams::GestureType |
| 30 SyntheticSmoothScrollGestureParams::GetGestureType() const { | 31 SyntheticSmoothScrollGestureParams::GetGestureType() const { |
| 31 return SMOOTH_SCROLL_GESTURE; | 32 return SMOOTH_SCROLL_GESTURE; |
| 32 } | 33 } |
| 33 | 34 |
| 34 const SyntheticSmoothScrollGestureParams* | 35 const SyntheticSmoothScrollGestureParams* |
| 35 SyntheticSmoothScrollGestureParams::Cast( | 36 SyntheticSmoothScrollGestureParams::Cast( |
| 36 const SyntheticGestureParams* gesture_params) { | 37 const SyntheticGestureParams* gesture_params) { |
| 37 DCHECK(gesture_params); | 38 DCHECK(gesture_params); |
| 38 DCHECK_EQ(SMOOTH_SCROLL_GESTURE, gesture_params->GetGestureType()); | 39 DCHECK_EQ(SMOOTH_SCROLL_GESTURE, gesture_params->GetGestureType()); |
| 39 return static_cast<const SyntheticSmoothScrollGestureParams*>(gesture_params); | 40 return static_cast<const SyntheticSmoothScrollGestureParams*>(gesture_params); |
| 40 } | 41 } |
| 41 | 42 |
| 42 } // namespace content | 43 } // namespace content |
| OLD | NEW |