OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2012 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/port/browser/smooth_scroll_gesture.h" |
| 6 |
| 7 namespace content { |
| 8 |
| 9 double SmoothScrollGesture::Tick( |
| 10 base::TimeTicks now, double desired_interval_ms) { |
| 11 double position_delta = 10; |
| 12 if (!last_tick_time_.is_null()) { |
| 13 double velocity = 10 / desired_interval_ms; |
| 14 double time_delta = (now - last_tick_time_).InMillisecondsF(); |
| 15 position_delta = velocity * time_delta; |
| 16 } |
| 17 |
| 18 last_tick_time_ = now; |
| 19 return position_delta; |
| 20 } |
| 21 |
| 22 } // namespace content |
OLD | NEW |