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 9 namespace content { 10 namespace { 11 12 const int kDefaultSpeedInPixelsS = 800; 13 14 } // namespace 15 16 SyntheticSmoothScrollGestureParams::SyntheticSmoothScrollGestureParams() 17 : prevent_fling(true), speed_in_pixels_s(kDefaultSpeedInPixelsS) {} 18 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) {} 26 27 SyntheticSmoothScrollGestureParams::~SyntheticSmoothScrollGestureParams() {} 28 29 SyntheticGestureParams::GestureType 30 SyntheticSmoothScrollGestureParams::GetGestureType() const { 31 return SMOOTH_SCROLL_GESTURE; 32 } 33 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); 40 } 41 42 } // namespace content 43