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_BROWSER_RENDERER_HOST_INPUT_WEB_INPUT_EVENT_UTIL_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_INPUT_WEB_INPUT_EVENT_UTIL_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_WEB_INPUT_EVENT_UTIL_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_WEB_INPUT_EVENT_UTIL_H_ |
7 | 7 |
| 8 #include "base/time/time.h" |
8 #include "content/common/content_export.h" | 9 #include "content/common/content_export.h" |
9 #include "third_party/WebKit/public/web/WebInputEvent.h" | 10 #include "third_party/WebKit/public/web/WebInputEvent.h" |
10 #include "ui/events/keycodes/keyboard_codes.h" | 11 #include "ui/events/keycodes/keyboard_codes.h" |
11 | 12 |
12 namespace ui { | 13 namespace ui { |
13 struct GestureEventData; | 14 struct GestureEventData; |
| 15 struct GestureEventDetails; |
14 class MotionEvent; | 16 class MotionEvent; |
15 } | 17 } |
16 | 18 |
17 namespace content { | 19 namespace content { |
18 | 20 |
19 // Update |event|'s windowsKeyCode and keyIdentifer properties using the | 21 // Update |event|'s windowsKeyCode and keyIdentifer properties using the |
20 // provided |windows_key_code|. | 22 // provided |windows_key_code|. |
21 CONTENT_EXPORT void UpdateWindowsKeyCodeAndKeyIdentifier( | 23 CONTENT_EXPORT void UpdateWindowsKeyCodeAndKeyIdentifier( |
22 blink::WebKeyboardEvent* event, | 24 blink::WebKeyboardEvent* event, |
23 ui::KeyboardCode windows_key_code); | 25 ui::KeyboardCode windows_key_code); |
24 | 26 |
25 // Creates a WebTouchEvent from |event|, scaling all size components from | |
26 // |event| by |scale|. | |
27 CONTENT_EXPORT blink::WebTouchEvent CreateWebTouchEventFromMotionEvent( | 27 CONTENT_EXPORT blink::WebTouchEvent CreateWebTouchEventFromMotionEvent( |
28 const ui::MotionEvent& event); | 28 const ui::MotionEvent& event); |
29 | 29 |
30 // Creates a WebGestureEvent from |event|, scaling all size components from | 30 CONTENT_EXPORT blink::WebGestureEvent CreateWebGestureEvent( |
31 // |event| by |scale|. | 31 const ui::GestureEventDetails& details, |
32 CONTENT_EXPORT blink::WebGestureEvent CreateWebGestureEventFromGestureEventData( | 32 base::TimeDelta timestamp, |
33 const ui::GestureEventData& data); | 33 const gfx::PointF& location, |
| 34 const gfx::PointF& raw_location, |
| 35 int flags); |
| 36 |
| 37 // Convenience wrapper for |CreateWebGestureEvent| using the supplied |data|. |
| 38 CONTENT_EXPORT blink::WebGestureEvent |
| 39 CreateWebGestureEventFromGestureEventData(const ui::GestureEventData& data); |
34 | 40 |
35 int EventFlagsToWebEventModifiers(int flags); | 41 int EventFlagsToWebEventModifiers(int flags); |
36 | 42 |
37 int WebEventModifiersToEventFlags(int modifiers); | 43 int WebEventModifiersToEventFlags(int modifiers); |
38 | 44 |
39 } // namespace content | 45 } // namespace content |
40 | 46 |
41 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_WEB_INPUT_EVENT_UTIL_H_ | 47 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_WEB_INPUT_EVENT_UTIL_H_ |
OLD | NEW |