| Index: content/browser/renderer_host/smooth_scroll_calculator.cc
|
| diff --git a/content/browser/renderer_host/smooth_scroll_calculator.cc b/content/browser/renderer_host/smooth_scroll_calculator.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..2538a188354a5a0c965fef1620dc541df5f05531
|
| --- /dev/null
|
| +++ b/content/browser/renderer_host/smooth_scroll_calculator.cc
|
| @@ -0,0 +1,28 @@
|
| +// Copyright (c) 2013 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/browser/renderer_host/smooth_scroll_calculator.h"
|
| +
|
| +namespace content {
|
| +
|
| +SmoothScrollCalculator::SmoothScrollCalculator() {
|
| +}
|
| +
|
| +SmoothScrollCalculator::~SmoothScrollCalculator() {
|
| +}
|
| +
|
| +double SmoothScrollCalculator::GetScrollDelta(
|
| + base::TimeTicks now, base::TimeDelta desired_interval) {
|
| + double position_delta = 10;
|
| + if (!last_tick_time_.is_null()) {
|
| + double velocity = 10 / desired_interval.InMillisecondsF();
|
| + double time_delta = (now - last_tick_time_).InMillisecondsF();
|
| + position_delta = velocity * time_delta;
|
| + }
|
| +
|
| + last_tick_time_ = now;
|
| + return position_delta;
|
| +}
|
| +
|
| +} // namespace content
|
|
|