OLD | NEW |
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_WEB_INPUT_EVENT_TRAITS_H_ | 5 #ifndef CONTENT_COMMON_INPUT_WEB_INPUT_EVENT_TRAITS_H_ |
6 #define CONTENT_COMMON_INPUT_WEB_INPUT_EVENT_TRAITS_H_ | 6 #define CONTENT_COMMON_INPUT_WEB_INPUT_EVENT_TRAITS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "content/common/input/scoped_web_input_event.h" | 11 #include "content/common/input/scoped_web_input_event.h" |
12 #include "third_party/WebKit/public/web/WebInputEvent.h" | 12 #include "third_party/WebKit/public/web/WebInputEvent.h" |
13 | 13 |
14 namespace content { | 14 namespace content { |
15 | 15 |
16 // Utility class for performing operations on and with WebInputEvents. | 16 // Utility class for performing operations on and with WebInputEvents. |
17 class CONTENT_EXPORT WebInputEventTraits { | 17 class CONTENT_EXPORT WebInputEventTraits { |
18 public: | 18 public: |
19 static const char* GetName(blink::WebInputEvent::Type type); | 19 static const char* GetName(blink::WebInputEvent::Type type); |
20 static std::string ToString(const blink::WebInputEvent& event); | 20 static std::string ToString(const blink::WebInputEvent& event); |
21 static size_t GetSize(blink::WebInputEvent::Type type); | 21 static size_t GetSize(blink::WebInputEvent::Type type); |
22 static ScopedWebInputEvent Clone(const blink::WebInputEvent& event); | 22 static ScopedWebInputEvent Clone(const blink::WebInputEvent& event); |
23 static void Delete(blink::WebInputEvent* event); | 23 static void Delete(blink::WebInputEvent* event); |
24 static bool CanCoalesce(const blink::WebInputEvent& event_to_coalesce, | 24 static bool CanCoalesce(const blink::WebInputEvent& event_to_coalesce, |
25 const blink::WebInputEvent& event); | 25 const blink::WebInputEvent& event); |
26 static void Coalesce(const blink::WebInputEvent& event_to_coalesce, | 26 static void Coalesce(const blink::WebInputEvent& event_to_coalesce, |
27 blink::WebInputEvent* event); | 27 blink::WebInputEvent* event); |
28 static bool IgnoresAckDisposition(const blink::WebInputEvent& event); | 28 static bool WillReceiveAckFromRenderer(const blink::WebInputEvent& event); |
| 29 |
| 30 // Return uniqueTouchEventId for WebTouchEvent, otherwise return 0. |
| 31 static uint32 GetUniqueTouchEventId(const blink::WebInputEvent& event); |
29 }; | 32 }; |
30 | 33 |
31 } // namespace content | 34 } // namespace content |
32 | 35 |
33 #endif // CONTENT_COMMON_INPUT_WEB_INPUT_EVENT_TRAITS_H_ | 36 #endif // CONTENT_COMMON_INPUT_WEB_INPUT_EVENT_TRAITS_H_ |
OLD | NEW |