summaryrefslogtreecommitdiffstats
path: root/content/port/browser/smooth_scroll_gesture.h
blob: d4682cc4f7d9b5fe83c1ca285cc63ed94ac145b1 (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
30
31
32
33
34
35
36
// 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.

#ifndef CONTENT_PORT_BROWSER_SMOOTH_SCROLL_GESTURE_H_
#define CONTENT_PORT_BROWSER_SMOOTH_SCROLL_GESTURE_H_

#include "base/memory/ref_counted.h"
#include "base/time/time.h"

namespace content {

class RenderWidgetHost;

// This is a base class representing a single scroll gesture. These gestures are
// paired with the rendering benchmarking system to (automatically) measure how
// smoothnly chrome is responding to user input.
class SmoothScrollGesture : public base::RefCounted<SmoothScrollGesture> {
 public:

  // When called, the gesture should compute its state at the provided timestamp
  // and send the right input events to the provided RenderWidgetHost to
  // simulate the gesture having run up to that point in time.
  //
  // This function should return true until the gesture is over. A false return
  // value will stop ticking the gesture and clean it up.
  virtual bool ForwardInputEvents(base::TimeTicks now,
                                  RenderWidgetHost* host) = 0;
 protected:
  friend class base::RefCounted<SmoothScrollGesture>;
  virtual ~SmoothScrollGesture() {}
};

} // namespace content

#endif // CONTENT_PORT_BROWSER_SMOOTH_SCROLL_GESTURE_H_