| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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_RENDERER_SCOPED_WEB_INPUT_EVENT_WITH_LATENCY_INFO_H_ | 5 #ifndef CONTENT_RENDERER_SCOPED_WEB_INPUT_EVENT_WITH_LATENCY_INFO_H_ |
| 6 #define CONTENT_RENDERER_SCOPED_WEB_INPUT_EVENT_WITH_LATENCY_INFO_H_ | 6 #define CONTENT_RENDERER_SCOPED_WEB_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/WebCoalescedInputEvent.h" |
| 12 #include "third_party/WebKit/public/platform/WebGestureEvent.h" | 12 #include "third_party/WebKit/public/platform/WebGestureEvent.h" |
| 13 #include "third_party/WebKit/public/platform/WebMouseWheelEvent.h" | 13 #include "third_party/WebKit/public/platform/WebMouseWheelEvent.h" |
| 14 #include "third_party/WebKit/public/platform/WebTouchEvent.h" | 14 #include "third_party/WebKit/public/platform/WebTouchEvent.h" |
| 15 #include "ui/events/blink/blink_event_util.h" | 15 #include "ui/events/blink/blink_event_util.h" |
| 16 #include "ui/events/blink/web_input_event_traits.h" | 16 #include "ui/events/blink/web_input_event_traits.h" |
| 17 #include "ui/events/latency_info.h" | 17 #include "ui/latency/latency_info.h" |
| 18 | 18 |
| 19 namespace content { | 19 namespace content { |
| 20 | 20 |
| 21 class ScopedWebInputEventWithLatencyInfo { | 21 class ScopedWebInputEventWithLatencyInfo { |
| 22 public: | 22 public: |
| 23 ScopedWebInputEventWithLatencyInfo(ui::WebScopedInputEvent, | 23 ScopedWebInputEventWithLatencyInfo(ui::WebScopedInputEvent, |
| 24 const ui::LatencyInfo&); | 24 const ui::LatencyInfo&); |
| 25 | 25 |
| 26 ~ScopedWebInputEventWithLatencyInfo(); | 26 ~ScopedWebInputEventWithLatencyInfo(); |
| 27 | 27 |
| 28 bool CanCoalesceWith(const ScopedWebInputEventWithLatencyInfo& other) const | 28 bool CanCoalesceWith(const ScopedWebInputEventWithLatencyInfo& other) const |
| 29 WARN_UNUSED_RESULT; | 29 WARN_UNUSED_RESULT; |
| 30 | 30 |
| 31 const blink::WebInputEvent& event() const; | 31 const blink::WebInputEvent& event() const; |
| 32 const blink::WebCoalescedInputEvent& coalesced_event() const; | 32 const blink::WebCoalescedInputEvent& coalesced_event() const; |
| 33 blink::WebInputEvent& event(); | 33 blink::WebInputEvent& event(); |
| 34 const ui::LatencyInfo latencyInfo() const { return latency_; } | 34 const ui::LatencyInfo latencyInfo() const { return latency_; } |
| 35 | 35 |
| 36 void CoalesceWith(const ScopedWebInputEventWithLatencyInfo& other); | 36 void CoalesceWith(const ScopedWebInputEventWithLatencyInfo& other); |
| 37 | 37 |
| 38 private: | 38 private: |
| 39 blink::WebScopedCoalescedInputEvent event_; | 39 blink::WebScopedCoalescedInputEvent event_; |
| 40 mutable ui::LatencyInfo latency_; | 40 mutable ui::LatencyInfo latency_; |
| 41 }; | 41 }; |
| 42 | 42 |
| 43 } // namespace content | 43 } // namespace content |
| 44 | 44 |
| 45 #endif // CONTENT_RENDERER_SCOPED_WEB_INPUT_EVENT_WITH_LATENCY_INFO_H_ | 45 #endif // CONTENT_RENDERER_SCOPED_WEB_INPUT_EVENT_WITH_LATENCY_INFO_H_ |
| OLD | NEW |