OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_BROWSER_RENDERER_HOST_SMOOTH_SCROLL_CALCULATOR_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_SMOOTH_SCROLL_CALCULATOR_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_SMOOTH_SCROLL_CALCULATOR_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_SMOOTH_SCROLL_CALCULATOR_H_ |
7 | 7 |
8 #include "base/time.h" | 8 #include "base/time/time.h" |
9 | 9 |
10 namespace content { | 10 namespace content { |
11 | 11 |
12 // An utility class to calculate the delta for smooth scroll gesture | 12 // An utility class to calculate the delta for smooth scroll gesture |
13 // events. | 13 // events. |
14 class SmoothScrollCalculator { | 14 class SmoothScrollCalculator { |
15 public: | 15 public: |
16 SmoothScrollCalculator(); | 16 SmoothScrollCalculator(); |
17 ~SmoothScrollCalculator(); | 17 ~SmoothScrollCalculator(); |
18 | 18 |
19 double GetScrollDelta(base::TimeTicks now, base::TimeDelta desired_interval); | 19 double GetScrollDelta(base::TimeTicks now, base::TimeDelta desired_interval); |
20 | 20 |
21 private: | 21 private: |
22 base::TimeTicks last_tick_time_; | 22 base::TimeTicks last_tick_time_; |
23 | 23 |
24 DISALLOW_COPY_AND_ASSIGN(SmoothScrollCalculator); | 24 DISALLOW_COPY_AND_ASSIGN(SmoothScrollCalculator); |
25 }; | 25 }; |
26 | 26 |
27 } // namespace content | 27 } // namespace content |
28 | 28 |
29 #endif // CONTENT_BROWSER_RENDERER_HOST_SMOOTH_SCROLL_CALCULATOR_H_ | 29 #endif // CONTENT_BROWSER_RENDERER_HOST_SMOOTH_SCROLL_CALCULATOR_H_ |
OLD | NEW |