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 15 matching lines...) Expand all Loading... | |
26 struct GestureEventData; | 26 struct GestureEventData; |
27 struct GestureEventDetails; | 27 struct GestureEventDetails; |
28 class MotionEvent; | 28 class MotionEvent; |
29 | 29 |
30 bool CanCoalesce(const blink::WebInputEvent& event_to_coalesce, | 30 bool CanCoalesce(const blink::WebInputEvent& event_to_coalesce, |
31 const blink::WebInputEvent& event); | 31 const blink::WebInputEvent& event); |
32 | 32 |
33 void Coalesce(const blink::WebInputEvent& event_to_coalesce, | 33 void Coalesce(const blink::WebInputEvent& event_to_coalesce, |
34 blink::WebInputEvent* event); | 34 blink::WebInputEvent* event); |
35 | 35 |
36 bool IsCompatibleScrollorPinch(const blink::WebGestureEvent& new_event, | |
37 const blink::WebGestureEvent& event_in_queue); | |
38 | |
39 // Coalesces 3 GestureScroll/PinchUpdate into 2 events. | |
40 // Returns <GestureScrollUpdate, GesturePinchUpdate>. | |
41 std::pair<blink::WebGestureEvent, blink::WebGestureEvent> | |
42 CoalesceScrollAndPinch(const blink::WebGestureEvent* second_last_event, | |
43 const blink::WebGestureEvent& last_event, | |
44 const blink::WebGestureEvent& new_event); | |
45 | |
36 blink::WebTouchEvent CreateWebTouchEventFromMotionEvent( | 46 blink::WebTouchEvent CreateWebTouchEventFromMotionEvent( |
37 const MotionEvent& event, | 47 const MotionEvent& event, |
38 bool may_cause_scrolling); | 48 bool may_cause_scrolling); |
39 | 49 |
40 blink::WebGestureEvent CreateWebGestureEvent(const GestureEventDetails& details, | 50 blink::WebGestureEvent CreateWebGestureEvent(const GestureEventDetails& details, |
41 base::TimeTicks timestamp, | 51 base::TimeTicks timestamp, |
42 const gfx::PointF& location, | 52 const gfx::PointF& location, |
43 const gfx::PointF& raw_location, | 53 const gfx::PointF& raw_location, |
44 int flags, | 54 int flags, |
45 uint32_t unique_touch_event_id); | 55 uint32_t unique_touch_event_id); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
77 | 87 |
78 int WebEventModifiersToEventFlags(int modifiers); | 88 int WebEventModifiersToEventFlags(int modifiers); |
79 | 89 |
80 blink::WebInputEvent::Modifiers DomCodeToWebInputEventModifiers( | 90 blink::WebInputEvent::Modifiers DomCodeToWebInputEventModifiers( |
81 ui::DomCode code); | 91 ui::DomCode code); |
82 | 92 |
83 bool IsGestureScollOrPinch(blink::WebInputEvent::Type); | 93 bool IsGestureScollOrPinch(blink::WebInputEvent::Type); |
84 | 94 |
85 bool IsContinuousGestureEvent(blink::WebInputEvent::Type); | 95 bool IsContinuousGestureEvent(blink::WebInputEvent::Type); |
86 | 96 |
97 const blink::WebGestureEvent* ToWebGestureEvent(const blink::WebInputEvent*); | |
dtapuska
2016/12/13 15:57:23
Can't these be inline functions?
chongz
2016/12/13 16:30:44
Done.
| |
98 const blink::WebGestureEvent& ToWebGestureEvent(const blink::WebInputEvent&); | |
99 | |
87 } // namespace ui | 100 } // namespace ui |
88 | 101 |
89 #endif // UI_EVENTS_BLINK_BLINK_EVENT_UTIL_H_ | 102 #endif // UI_EVENTS_BLINK_BLINK_EVENT_UTIL_H_ |
OLD | NEW |