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.
4
5#include "content/common/input/synthetic_smooth_scroll_gesture_params.h"
6
7#include "base/logging.h"
8
9namespace content {
10namespace {
11
12const int kDefaultSpeedInPixelsS = 800;
13
14}  // namespace
15
16SyntheticSmoothScrollGestureParams::SyntheticSmoothScrollGestureParams()
17    : prevent_fling(true), speed_in_pixels_s(kDefaultSpeedInPixelsS) {}
18
19SyntheticSmoothScrollGestureParams::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) {}
26
27SyntheticSmoothScrollGestureParams::~SyntheticSmoothScrollGestureParams() {}
28
29SyntheticGestureParams::GestureType
30SyntheticSmoothScrollGestureParams::GetGestureType() const {
31  return SMOOTH_SCROLL_GESTURE;
32}
33
34const SyntheticSmoothScrollGestureParams*
35SyntheticSmoothScrollGestureParams::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);
40}
41
42}  // namespace content
43