| 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 #include "content/port/browser/event_with_latency_info.h" | 10 #include "content/port/browser/event_with_latency_info.h" |
| 11 | 11 |
| 12 namespace WebKit { | 12 namespace blink { |
| 13 class WebGestureEvent; | 13 class WebGestureEvent; |
| 14 class WebTouchEvent; | 14 class WebTouchEvent; |
| 15 class WebTouchPoint; | 15 class WebTouchPoint; |
| 16 } | 16 } |
| 17 | 17 |
| 18 namespace ui { | 18 namespace ui { |
| 19 class GestureEvent; | 19 class GestureEvent; |
| 20 class TouchEvent; | 20 class TouchEvent; |
| 21 } | 21 } |
| 22 | 22 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 34 // WebTouchEvent. All the ui::TouchEvent in the list will carry the same | 34 // WebTouchEvent. All the ui::TouchEvent in the list will carry the same |
| 35 // LatencyInfo the WebTouchEvent carries. | 35 // LatencyInfo the WebTouchEvent carries. |
| 36 CONTENT_EXPORT bool MakeUITouchEventsFromWebTouchEvents( | 36 CONTENT_EXPORT bool MakeUITouchEventsFromWebTouchEvents( |
| 37 const TouchEventWithLatencyInfo& touch, | 37 const TouchEventWithLatencyInfo& touch, |
| 38 ScopedVector<ui::TouchEvent>* list, | 38 ScopedVector<ui::TouchEvent>* list, |
| 39 TouchEventCoordinateSystem coordinate_system); | 39 TouchEventCoordinateSystem coordinate_system); |
| 40 | 40 |
| 41 // Creates a WebGestureEvent from a ui::GestureEvent. Note that it does not | 41 // Creates a WebGestureEvent from a ui::GestureEvent. Note that it does not |
| 42 // populate the event coordinates (i.e. |x|, |y|, |globalX|, and |globalY|). So | 42 // populate the event coordinates (i.e. |x|, |y|, |globalX|, and |globalY|). So |
| 43 // the caller must populate these fields. | 43 // the caller must populate these fields. |
| 44 WebKit::WebGestureEvent MakeWebGestureEventFromUIEvent( | 44 blink::WebGestureEvent MakeWebGestureEventFromUIEvent( |
| 45 const ui::GestureEvent& event); | 45 const ui::GestureEvent& event); |
| 46 | 46 |
| 47 int EventFlagsToWebEventModifiers(int flags); | 47 int EventFlagsToWebEventModifiers(int flags); |
| 48 | 48 |
| 49 // Updates the WebTouchEvent based on the TouchEvent. It returns the updated | 49 // Updates the WebTouchEvent based on the TouchEvent. It returns the updated |
| 50 // WebTouchPoint contained in the WebTouchEvent, or NULL if no point was | 50 // WebTouchPoint contained in the WebTouchEvent, or NULL if no point was |
| 51 // updated. | 51 // updated. |
| 52 WebKit::WebTouchPoint* UpdateWebTouchEventFromUIEvent( | 52 blink::WebTouchPoint* UpdateWebTouchEventFromUIEvent( |
| 53 const ui::TouchEvent& event, | 53 const ui::TouchEvent& event, |
| 54 WebKit::WebTouchEvent* web_event); | 54 blink::WebTouchEvent* web_event); |
| 55 } | 55 } |
| 56 | 56 |
| 57 #endif // CONTENT_BROWSER_RENDERER_HOST_UI_EVENTS_HELPER_H_ | 57 #endif // CONTENT_BROWSER_RENDERER_HOST_UI_EVENTS_HELPER_H_ |
| OLD | NEW |