summaryrefslogtreecommitdiffstats
path: root/content/browser/renderer_host/smooth_scroll_calculator.h
blob: ae406a8334a7caa9aed6fef5a21043e40af1a4e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// 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.

#ifndef CONTENT_BROWSER_RENDERER_HOST_SMOOTH_SCROLL_CALCULATOR_H_
#define CONTENT_BROWSER_RENDERER_HOST_SMOOTH_SCROLL_CALCULATOR_H_

#include "base/time.h"

namespace content {

// An utility class to calculate the delta for smooth scroll gesture
// events.
class SmoothScrollCalculator {
 public:
  SmoothScrollCalculator();
  ~SmoothScrollCalculator();

  double GetScrollDelta(base::TimeTicks now, base::TimeDelta desired_interval);

 private:
  base::TimeTicks last_tick_time_;

  DISALLOW_COPY_AND_ASSIGN(SmoothScrollCalculator);
};

} // namespace content

#endif  // CONTENT_BROWSER_RENDERER_HOST_SMOOTH_SCROLL_CALCULATOR_H_