summaryrefslogtreecommitdiffstats
path: root/content/port/browser/event_with_latency_info.h
blob: 70788f94c111862f4d1c8c46faf742bbcc79eff4 (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
37
38
39
40
41
42
// Copyright 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_PORT_BROWSER_EVENT_WITH_LATENCY_INFO_H_
#define CONTENT_PORT_BROWSER_EVENT_WITH_LATENCY_INFO_H_

#include "ui/base/latency_info.h"

namespace WebKit {
class WebGestureEvent;
class WebMouseEvent;
class WebMouseWheelEvent;
class WebTouchEvent;
}

namespace content {

template <typename T>
class EventWithLatencyInfo {
 public:
  T event;
  ui::LatencyInfo latency;

  EventWithLatencyInfo(const T& e, const ui::LatencyInfo& l)
      : event(e), latency(l) {}

  EventWithLatencyInfo() {}
};

typedef EventWithLatencyInfo<WebKit::WebGestureEvent>
    GestureEventWithLatencyInfo;
typedef EventWithLatencyInfo<WebKit::WebMouseWheelEvent>
    MouseWheelEventWithLatencyInfo;
typedef EventWithLatencyInfo<WebKit::WebMouseEvent>
    MouseEventWithLatencyInfo;
typedef EventWithLatencyInfo<WebKit::WebTouchEvent>
    TouchEventWithLatencyInfo;

}  // namespace content

#endif  // CONTENT_PORT_BROWSER_EVENT_WITH_LATENCY_INFO_H_