Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / content / common / input / synthetic_smooth_scroll_gesture_params.cc
blob8e1c974827020f2f2f6e79400fe855da021c5f5b
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"
9 namespace content {
10 namespace {
12 const float kDefaultSpeedInPixelsS = 800;
14 } // namespace
16 SyntheticSmoothScrollGestureParams::SyntheticSmoothScrollGestureParams()
17 : prevent_fling(true), speed_in_pixels_s(kDefaultSpeedInPixelsS) {}
19 SyntheticSmoothScrollGestureParams::SyntheticSmoothScrollGestureParams(
20 const SyntheticSmoothScrollGestureParams& other)
21 : SyntheticGestureParams(other),
22 anchor(other.anchor),
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