1ca12bfac764ba476d6cd062bf1dde12cc64c3f40Ben Murdoch// Copyright 2013 The Chromium Authors. All rights reserved.
22a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
32a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// found in the LICENSE file.
42a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
5ca12bfac764ba476d6cd062bf1dde12cc64c3f40Ben Murdoch#include "content/common/input/synthetic_smooth_scroll_gesture_params.h"
62a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
74e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)#include "base/logging.h"
84e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)
94e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)namespace content {
104e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)namespace {
115d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
125d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)const int kDefaultSpeedInPixelsS = 800;
135d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
14f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)}  // namespace
154e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)
165d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)SyntheticSmoothScrollGestureParams::SyntheticSmoothScrollGestureParams()
177d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)    : prevent_fling(true), speed_in_pixels_s(kDefaultSpeedInPixelsS) {}
182a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
192a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)SyntheticSmoothScrollGestureParams::SyntheticSmoothScrollGestureParams(
20ca12bfac764ba476d6cd062bf1dde12cc64c3f40Ben Murdoch      const SyntheticSmoothScrollGestureParams& other)
212a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)    : SyntheticGestureParams(other),
22ca12bfac764ba476d6cd062bf1dde12cc64c3f40Ben Murdoch      anchor(other.anchor),
237d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)      distances(other.distances),
244e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)      prevent_fling(other.prevent_fling),
254e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)      speed_in_pixels_s(other.speed_in_pixels_s) {}
264e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)
27ca12bfac764ba476d6cd062bf1dde12cc64c3f40Ben MurdochSyntheticSmoothScrollGestureParams::~SyntheticSmoothScrollGestureParams() {}
284e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)
294e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)SyntheticGestureParams::GestureType
304e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)SyntheticSmoothScrollGestureParams::GetGestureType() const {
312a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  return SMOOTH_SCROLL_GESTURE;
322a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)}
332a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
34ca12bfac764ba476d6cd062bf1dde12cc64c3f40Ben Murdochconst SyntheticSmoothScrollGestureParams*
357d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)SyntheticSmoothScrollGestureParams::Cast(
367d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)    const SyntheticGestureParams* gesture_params) {
377d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)  DCHECK(gesture_params);
387d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)  DCHECK_EQ(SMOOTH_SCROLL_GESTURE, gesture_params->GetGestureType());
3968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)  return static_cast<const SyntheticSmoothScrollGestureParams*>(gesture_params);
407d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)}
417d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)
427d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)}  // namespace content
434e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)