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/WebGestureEvent.h" |
8 #include "third_party/WebKit/public/platform/WebInputEvent.h" | 9 #include "third_party/WebKit/public/platform/WebInputEvent.h" |
9 #include "ui/events/blink/scoped_web_input_event.h" | 10 #include "ui/events/blink/scoped_web_input_event.h" |
10 #include "ui/events/latency_info.h" | 11 #include "ui/events/latency_info.h" |
11 | 12 |
12 namespace ui { | 13 namespace ui { |
13 | 14 |
14 // Utility class for performing operations on and with WebInputEvents. | 15 // Utility class for performing operations on and with WebInputEvents. |
15 class WebInputEventTraits { | 16 class WebInputEventTraits { |
16 public: | 17 public: |
17 static std::string ToString(const blink::WebInputEvent& event); | 18 static std::string ToString(const blink::WebInputEvent& event); |
18 static size_t GetSize(blink::WebInputEvent::Type type); | 19 static size_t GetSize(blink::WebInputEvent::Type type); |
19 static ScopedWebInputEvent Clone(const blink::WebInputEvent& event); | 20 static ScopedWebInputEvent Clone(const blink::WebInputEvent& event); |
20 static void Delete(blink::WebInputEvent* event); | 21 static void Delete(blink::WebInputEvent* event); |
21 static bool ShouldBlockEventStream(const blink::WebInputEvent& event); | 22 static bool ShouldBlockEventStream(const blink::WebInputEvent& event); |
22 | 23 |
23 static bool CanCauseScroll(const blink::WebMouseWheelEvent& event); | 24 static bool CanCauseScroll(const blink::WebMouseWheelEvent& event); |
24 | 25 |
25 // Return uniqueTouchEventId for WebTouchEvent, otherwise return 0. | 26 // Return uniqueTouchEventId for WebTouchEvent, otherwise return 0. |
26 static uint32_t GetUniqueTouchEventId(const blink::WebInputEvent& event); | 27 static uint32_t GetUniqueTouchEventId(const blink::WebInputEvent& event); |
27 static LatencyInfo CreateLatencyInfoForWebGestureEvent( | 28 static LatencyInfo CreateLatencyInfoForWebGestureEvent( |
28 blink::WebGestureEvent event); | 29 blink::WebGestureEvent event); |
29 }; | 30 }; |
30 | 31 |
31 } // namespace ui | 32 } // namespace ui |
32 | 33 |
33 #endif // UI_EVENTS_BLINK_WEB_INPUT_EVENT_TRAITS_H_ | 34 #endif // UI_EVENTS_BLINK_WEB_INPUT_EVENT_TRAITS_H_ |
OLD | NEW |