Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(402)

Side by Side Diff: content/common/input/event_with_latency_info.h

Issue 2576013002: Introducing WebCoalescedInputEvent and inclusion in content/common (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 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 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_COMMON_INPUT_EVENT_WITH_LATENCY_INFO_H_ 5 #ifndef CONTENT_COMMON_INPUT_EVENT_WITH_LATENCY_INFO_H_
6 #define CONTENT_COMMON_INPUT_EVENT_WITH_LATENCY_INFO_H_ 6 #define CONTENT_COMMON_INPUT_EVENT_WITH_LATENCY_INFO_H_
7 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "content/common/content_export.h" 10 #include "content/common/content_export.h"
11 #include "third_party/WebKit/public/platform/WebCoalescedInputEvent.h"
11 #include "third_party/WebKit/public/platform/WebGestureEvent.h" 12 #include "third_party/WebKit/public/platform/WebGestureEvent.h"
12 #include "third_party/WebKit/public/platform/WebInputEvent.h"
13 #include "ui/events/blink/blink_event_util.h" 13 #include "ui/events/blink/blink_event_util.h"
14 #include "ui/events/blink/scoped_web_input_event.h"
15 #include "ui/events/latency_info.h" 14 #include "ui/events/latency_info.h"
16 15
17 namespace content { 16 namespace content {
18 17
19 class ScopedWebInputEventWithLatencyInfo { 18 class ScopedWebInputEventWithLatencyInfo {
20 public: 19 public:
21 ScopedWebInputEventWithLatencyInfo(ui::ScopedWebInputEvent, 20 ScopedWebInputEventWithLatencyInfo(
22 const ui::LatencyInfo&); 21 blink::WebCoalescedInputEvent::ScopedWebInputEvent,
22 const ui::LatencyInfo&);
23 23
24 ~ScopedWebInputEventWithLatencyInfo(); 24 ~ScopedWebInputEventWithLatencyInfo();
25 25
26 bool CanCoalesceWith(const ScopedWebInputEventWithLatencyInfo& other) const 26 bool CanCoalesceWith(const ScopedWebInputEventWithLatencyInfo& other) const
27 WARN_UNUSED_RESULT; 27 WARN_UNUSED_RESULT;
28 28
29 const blink::WebInputEvent& event() const; 29 const blink::WebCoalescedInputEvent& coalescedEvent() const;
30 blink::WebInputEvent& event(); 30 blink::WebCoalescedInputEvent& coalescedEvent();
31 const ui::LatencyInfo latencyInfo() const { return latency_; } 31 const ui::LatencyInfo latencyInfo() const { return latency_; }
32 32
33 void CoalesceWith(const ScopedWebInputEventWithLatencyInfo& other); 33 void CoalesceWith(const ScopedWebInputEventWithLatencyInfo& other);
34 34
35 private: 35 private:
36 ui::ScopedWebInputEvent event_; 36 blink::ScopedCoalescedWebInputEvent event_;
37 mutable ui::LatencyInfo latency_; 37 mutable ui::LatencyInfo latency_;
38 }; 38 };
39 39
40 template <typename T> 40 template <typename T>
41 class EventWithLatencyInfo { 41 class EventWithLatencyInfo {
42 public: 42 public:
43 T event; 43 T event;
44 mutable ui::LatencyInfo latency; 44 mutable ui::LatencyInfo latency;
45 45
46 explicit EventWithLatencyInfo(const T& e) : event(e) {} 46 explicit EventWithLatencyInfo(const T& e) : event(e) {}
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 typedef EventWithLatencyInfo<blink::WebMouseWheelEvent> 85 typedef EventWithLatencyInfo<blink::WebMouseWheelEvent>
86 MouseWheelEventWithLatencyInfo; 86 MouseWheelEventWithLatencyInfo;
87 typedef EventWithLatencyInfo<blink::WebMouseEvent> 87 typedef EventWithLatencyInfo<blink::WebMouseEvent>
88 MouseEventWithLatencyInfo; 88 MouseEventWithLatencyInfo;
89 typedef EventWithLatencyInfo<blink::WebTouchEvent> 89 typedef EventWithLatencyInfo<blink::WebTouchEvent>
90 TouchEventWithLatencyInfo; 90 TouchEventWithLatencyInfo;
91 91
92 } // namespace content 92 } // namespace content
93 93
94 #endif // CONTENT_COMMON_INPUT_EVENT_WITH_LATENCY_INFO_H_ 94 #endif // CONTENT_COMMON_INPUT_EVENT_WITH_LATENCY_INFO_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698