| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 UI_EVENTS_BLINK_WEB_INPUT_EVENT_TRAITS_H_ | 5 #ifndef UI_EVENTS_BLINK_WEB_INPUT_EVENT_TRAITS_H_ |
| 6 #define UI_EVENTS_BLINK_WEB_INPUT_EVENT_TRAITS_H_ | 6 #define UI_EVENTS_BLINK_WEB_INPUT_EVENT_TRAITS_H_ |
| 7 | 7 |
| 8 #include "third_party/WebKit/public/platform/WebInputEvent.h" | 8 #include "third_party/WebKit/public/platform/WebInputEvent.h" |
| 9 #include "ui/events/latency_info.h" | 9 #include "ui/events/latency_info.h" |
| 10 | 10 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 | 21 |
| 22 using WebScopedInputEvent = | 22 using WebScopedInputEvent = |
| 23 std::unique_ptr<blink::WebInputEvent, WebInputEventDeleter>; | 23 std::unique_ptr<blink::WebInputEvent, WebInputEventDeleter>; |
| 24 | 24 |
| 25 // Utility class for performing operations on and with WebInputEvents. | 25 // Utility class for performing operations on and with WebInputEvents. |
| 26 class WebInputEventTraits { | 26 class WebInputEventTraits { |
| 27 public: | 27 public: |
| 28 static std::string ToString(const blink::WebInputEvent& event); | 28 static std::string ToString(const blink::WebInputEvent& event); |
| 29 static size_t GetSize(blink::WebInputEvent::Type type); | 29 static size_t GetSize(blink::WebInputEvent::Type type); |
| 30 static WebScopedInputEvent Clone(const blink::WebInputEvent& event); | 30 static WebScopedInputEvent Clone(const blink::WebInputEvent& event); |
| 31 static bool ShouldBlockEventStream(const blink::WebInputEvent& event); | 31 static bool ShouldBlockEventStream(const blink::WebInputEvent& event, |
| 32 bool raf_aligned_touch_enabled); |
| 32 | 33 |
| 33 static bool CanCauseScroll(const blink::WebMouseWheelEvent& event); | 34 static bool CanCauseScroll(const blink::WebMouseWheelEvent& event); |
| 34 | 35 |
| 35 // Return uniqueTouchEventId for WebTouchEvent, otherwise return 0. | 36 // Return uniqueTouchEventId for WebTouchEvent, otherwise return 0. |
| 36 static uint32_t GetUniqueTouchEventId(const blink::WebInputEvent& event); | 37 static uint32_t GetUniqueTouchEventId(const blink::WebInputEvent& event); |
| 37 static LatencyInfo CreateLatencyInfoForWebGestureEvent( | 38 static LatencyInfo CreateLatencyInfoForWebGestureEvent( |
| 38 const blink::WebGestureEvent& event); | 39 const blink::WebGestureEvent& event); |
| 39 }; | 40 }; |
| 40 | 41 |
| 41 } // namespace ui | 42 } // namespace ui |
| 42 | 43 |
| 43 #endif // UI_EVENTS_BLINK_WEB_INPUT_EVENT_TRAITS_H_ | 44 #endif // UI_EVENTS_BLINK_WEB_INPUT_EVENT_TRAITS_H_ |
| OLD | NEW |