OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_UI_EVENTS_HELPER_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_UI_EVENTS_HELPER_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_UI_EVENTS_HELPER_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_UI_EVENTS_HELPER_H_ |
7 | 7 |
8 #include "base/memory/scoped_vector.h" | 8 #include "base/memory/scoped_vector.h" |
9 #include "content/common/content_export.h" | 9 #include "content/common/content_export.h" |
10 | 10 |
11 namespace WebKit { | 11 namespace WebKit { |
12 class WebTouchEvent; | 12 class WebTouchEvent; |
| 13 class WebTouchPoint; |
13 } | 14 } |
14 | 15 |
15 namespace ui { | 16 namespace ui { |
16 class TouchEvent; | 17 class TouchEvent; |
17 } | 18 } |
18 | 19 |
19 namespace content { | 20 namespace content { |
20 | 21 |
21 // Creates a list of ui::TouchEvents out of a single WebTouchEvent. | 22 // Creates a list of ui::TouchEvents out of a single WebTouchEvent. |
22 // A WebTouchEvent can contain information about a number of WebTouchPoints, | 23 // A WebTouchEvent can contain information about a number of WebTouchPoints, |
23 // whereas a ui::TouchEvent contains information about a single touch-point. So | 24 // whereas a ui::TouchEvent contains information about a single touch-point. So |
24 // it is possible to create more than one ui::TouchEvents out of a single | 25 // it is possible to create more than one ui::TouchEvents out of a single |
25 // WebTouchEvent. | 26 // WebTouchEvent. |
26 CONTENT_EXPORT bool MakeUITouchEventsFromWebTouchEvents( | 27 CONTENT_EXPORT bool MakeUITouchEventsFromWebTouchEvents( |
27 const WebKit::WebTouchEvent& touch, | 28 const WebKit::WebTouchEvent& touch, |
28 ScopedVector<ui::TouchEvent>* list); | 29 ScopedVector<ui::TouchEvent>* list); |
| 30 |
| 31 int EventFlagsToWebEventModifiers(int flags); |
| 32 |
| 33 // Updates the WebTouchEvent based on the TouchEvent. It returns the updated |
| 34 // WebTouchPoint contained in the WebTouchEvent, or NULL if no point was |
| 35 // updated. |
| 36 WebKit::WebTouchPoint* UpdateWebTouchEventFromUIEvent( |
| 37 ui::TouchEvent* event, |
| 38 WebKit::WebTouchEvent* web_event); |
29 } | 39 } |
30 | 40 |
31 #endif // CONTENT_BROWSER_RENDERER_HOST_UI_EVENTS_HELPER_H_ | 41 #endif // CONTENT_BROWSER_RENDERER_HOST_UI_EVENTS_HELPER_H_ |
OLD | NEW |