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
3 // found in the LICENSE file.
5 #include "content/common/input/synthetic_smooth_scroll_gesture_params.h"
7 #include "base/logging.h"
12 const float kDefaultSpeedInPixelsS
= 800;
16 SyntheticSmoothScrollGestureParams::SyntheticSmoothScrollGestureParams()
17 : prevent_fling(true), speed_in_pixels_s(kDefaultSpeedInPixelsS
) {}
19 SyntheticSmoothScrollGestureParams::SyntheticSmoothScrollGestureParams(
20 const SyntheticSmoothScrollGestureParams
& other
)
21 : SyntheticGestureParams(other
),
23 distances(other
.distances
),
24 prevent_fling(other
.prevent_fling
),
25 speed_in_pixels_s(other
.speed_in_pixels_s
) {}
27 SyntheticSmoothScrollGestureParams::~SyntheticSmoothScrollGestureParams() {}
29 SyntheticGestureParams::GestureType
30 SyntheticSmoothScrollGestureParams::GetGestureType() const {
31 return SMOOTH_SCROLL_GESTURE
;
34 const SyntheticSmoothScrollGestureParams
*
35 SyntheticSmoothScrollGestureParams::Cast(
36 const SyntheticGestureParams
* gesture_params
) {
37 DCHECK(gesture_params
);
38 DCHECK_EQ(SMOOTH_SCROLL_GESTURE
, gesture_params
->GetGestureType());
39 return static_cast<const SyntheticSmoothScrollGestureParams
*>(gesture_params
);
42 } // namespace content