Home | History | Annotate | Download | only in browser
      1 // Copyright 2013 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 #ifndef CONTENT_PORT_BROWSER_EVENT_WITH_LATENCY_INFO_H_
      6 #define CONTENT_PORT_BROWSER_EVENT_WITH_LATENCY_INFO_H_
      7 
      8 #include "ui/base/latency_info.h"
      9 
     10 namespace WebKit {
     11 class WebGestureEvent;
     12 class WebMouseEvent;
     13 class WebMouseWheelEvent;
     14 class WebTouchEvent;
     15 }
     16 
     17 namespace content {
     18 
     19 template <typename T>
     20 class EventWithLatencyInfo {
     21  public:
     22   T event;
     23   ui::LatencyInfo latency;
     24 
     25   EventWithLatencyInfo(const T& e, const ui::LatencyInfo& l)
     26       : event(e), latency(l) {}
     27 
     28   EventWithLatencyInfo() {}
     29 };
     30 
     31 typedef EventWithLatencyInfo<WebKit::WebGestureEvent>
     32     GestureEventWithLatencyInfo;
     33 typedef EventWithLatencyInfo<WebKit::WebMouseWheelEvent>
     34     MouseWheelEventWithLatencyInfo;
     35 typedef EventWithLatencyInfo<WebKit::WebMouseEvent>
     36     MouseEventWithLatencyInfo;
     37 typedef EventWithLatencyInfo<WebKit::WebTouchEvent>
     38     TouchEventWithLatencyInfo;
     39 
     40 }  // namespace content
     41 
     42 #endif  // CONTENT_PORT_BROWSER_EVENT_WITH_LATENCY_INFO_H_
     43