| 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 <memory> | 8 #include <memory> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "content/browser/renderer_host/event_with_latency_info.h" | 11 #include "content/browser/renderer_host/event_with_latency_info.h" |
| 12 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
| 13 #include "content/common/input/input_event_ack_state.h" |
| 13 | 14 |
| 14 namespace ui { | 15 namespace ui { |
| 15 class TouchEvent; | 16 class TouchEvent; |
| 16 } | 17 } |
| 17 | 18 |
| 18 namespace content { | 19 namespace content { |
| 19 | 20 |
| 20 enum TouchEventCoordinateSystem { | 21 enum TouchEventCoordinateSystem { |
| 21 SCREEN_COORDINATES, | 22 SCREEN_COORDINATES, |
| 22 LOCAL_COORDINATES | 23 LOCAL_COORDINATES |
| 23 }; | 24 }; |
| 24 | 25 |
| 25 // Creates a list of ui::TouchEvents out of a single WebTouchEvent. | 26 // Creates a list of ui::TouchEvents out of a single WebTouchEvent. |
| 26 // A WebTouchEvent can contain information about a number of WebTouchPoints, | 27 // A WebTouchEvent can contain information about a number of WebTouchPoints, |
| 27 // whereas a ui::TouchEvent contains information about a single touch-point. So | 28 // whereas a ui::TouchEvent contains information about a single touch-point. So |
| 28 // it is possible to create more than one ui::TouchEvents out of a single | 29 // it is possible to create more than one ui::TouchEvents out of a single |
| 29 // WebTouchEvent. All the ui::TouchEvent in the list will carry the same | 30 // WebTouchEvent. All the ui::TouchEvent in the list will carry the same |
| 30 // LatencyInfo the WebTouchEvent carries. | 31 // LatencyInfo the WebTouchEvent carries. |
| 31 // |coordinate_system| specifies which fields to use for the co-ordinates, | 32 // |coordinate_system| specifies which fields to use for the co-ordinates, |
| 32 // WebTouchPoint.position or WebTouchPoint.screenPosition. Is's up to the | 33 // WebTouchPoint.position or WebTouchPoint.screenPosition. Is's up to the |
| 33 // caller to do any co-ordinate system mapping (typically to get them into | 34 // caller to do any co-ordinate system mapping (typically to get them into |
| 34 // the Aura EventDispatcher co-ordinate system). | 35 // the Aura EventDispatcher co-ordinate system). |
| 35 CONTENT_EXPORT bool MakeUITouchEventsFromWebTouchEvents( | 36 CONTENT_EXPORT bool MakeUITouchEventsFromWebTouchEvents( |
| 36 const TouchEventWithLatencyInfo& touch, | 37 const TouchEventWithLatencyInfo& touch, |
| 37 std::vector<std::unique_ptr<ui::TouchEvent>>* list, | 38 std::vector<std::unique_ptr<ui::TouchEvent>>* list, |
| 38 TouchEventCoordinateSystem coordinate_system); | 39 TouchEventCoordinateSystem coordinate_system); |
| 39 | 40 |
| 41 // Utility to map the event ack state from the renderer, returns true if the |
| 42 // event could be handled non-blocking. |
| 43 bool InputEventAckStateIsSetNonBlocking(InputEventAckState); |
| 44 |
| 40 } // namespace content | 45 } // namespace content |
| 41 | 46 |
| 42 #endif // CONTENT_BROWSER_RENDERER_HOST_UI_EVENTS_HELPER_H_ | 47 #endif // CONTENT_BROWSER_RENDERER_HOST_UI_EVENTS_HELPER_H_ |
| OLD | NEW |