OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 UI_EVENTS_BLINK_BLINK_EVENT_UTIL_H_ | 5 #ifndef UI_EVENTS_BLINK_BLINK_EVENT_UTIL_H_ |
6 #define UI_EVENTS_BLINK_BLINK_EVENT_UTIL_H_ | 6 #define UI_EVENTS_BLINK_BLINK_EVENT_UTIL_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "third_party/WebKit/public/platform/WebInputEvent.h" | 10 #include "third_party/WebKit/public/platform/WebInputEvent.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 const gfx::PointF& raw_location, | 40 const gfx::PointF& raw_location, |
41 int flags, | 41 int flags, |
42 uint32_t unique_touch_event_id); | 42 uint32_t unique_touch_event_id); |
43 | 43 |
44 // Convenience wrapper for |CreateWebGestureEvent| using the supplied |data|. | 44 // Convenience wrapper for |CreateWebGestureEvent| using the supplied |data|. |
45 blink::WebGestureEvent CreateWebGestureEventFromGestureEventData( | 45 blink::WebGestureEvent CreateWebGestureEventFromGestureEventData( |
46 const GestureEventData& data); | 46 const GestureEventData& data); |
47 | 47 |
48 int EventFlagsToWebEventModifiers(int flags); | 48 int EventFlagsToWebEventModifiers(int flags); |
49 | 49 |
| 50 std::unique_ptr<blink::WebInputEvent> MakeDeepCopyOfWebInputEvent( |
| 51 const blink::WebInputEvent& event); |
| 52 |
| 53 // Returns a scaled version of |event| if |scale| is different than 1.0. |
| 54 // Otherwise returns nullptr. |
50 std::unique_ptr<blink::WebInputEvent> ScaleWebInputEvent( | 55 std::unique_ptr<blink::WebInputEvent> ScaleWebInputEvent( |
51 const blink::WebInputEvent& event, | 56 const blink::WebInputEvent& event, |
52 float scale); | 57 float scale); |
53 | 58 |
| 59 // Scales |event| by |scale| (mutating |event| in-place). |
| 60 void ScaleWebInputEvent(float scale, blink::WebInputEvent* event); |
| 61 |
| 62 // Shifts (i.e. translates) the |event| by (|delta_x|,|delta_y|) vector |
| 63 // (mutating |event| in-place). |
| 64 void ShiftWebInputEvent(int delta_x, int delta_y, blink::WebInputEvent* event); |
| 65 |
54 blink::WebPointerProperties::PointerType ToWebPointerType( | 66 blink::WebPointerProperties::PointerType ToWebPointerType( |
55 MotionEvent::ToolType tool_type); | 67 MotionEvent::ToolType tool_type); |
56 | 68 |
57 int WebEventModifiersToEventFlags(int modifiers); | 69 int WebEventModifiersToEventFlags(int modifiers); |
58 | 70 |
59 blink::WebInputEvent::Modifiers DomCodeToWebInputEventModifiers( | 71 blink::WebInputEvent::Modifiers DomCodeToWebInputEventModifiers( |
60 ui::DomCode code); | 72 ui::DomCode code); |
61 | 73 |
62 } // namespace ui | 74 } // namespace ui |
63 | 75 |
64 #endif // UI_EVENTS_BLINK_BLINK_EVENT_UTIL_H_ | 76 #endif // UI_EVENTS_BLINK_BLINK_EVENT_UTIL_H_ |
OLD | NEW |