| Index: content/port/browser/smooth_scroll_gesture.cc
|
| diff --git a/content/port/browser/smooth_scroll_gesture.cc b/content/port/browser/smooth_scroll_gesture.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..b783fc0a75cdd4fdaa995d058e5bc51c84c718a3
|
| --- /dev/null
|
| +++ b/content/port/browser/smooth_scroll_gesture.cc
|
| @@ -0,0 +1,22 @@
|
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "content/port/browser/smooth_scroll_gesture.h"
|
| +
|
| +namespace content {
|
| +
|
| +double SmoothScrollGesture::Tick(
|
| + base::TimeTicks now, double desired_interval_ms) {
|
| + double position_delta = 10;
|
| + if (!last_tick_time_.is_null()) {
|
| + double velocity = 10 / desired_interval_ms;
|
| + double time_delta = (now - last_tick_time_).InMillisecondsF();
|
| + position_delta = velocity * time_delta;
|
| + }
|
| +
|
| + last_tick_time_ = now;
|
| + return position_delta;
|
| +}
|
| +
|
| +} // namespace content
|
|
|