OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_INPUT_TOUCH_EMULATOR_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_INPUT_TOUCH_EMULATOR_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_TOUCH_EMULATOR_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_TOUCH_EMULATOR_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 WebCursor* cursor, float scale, int resource_id); | 62 WebCursor* cursor, float scale, int resource_id); |
63 bool InitCursors(float device_scale_factor, bool force); | 63 bool InitCursors(float device_scale_factor, bool force); |
64 void ResetState(); | 64 void ResetState(); |
65 void UpdateCursor(); | 65 void UpdateCursor(); |
66 bool UpdateShiftPressed(bool shift_pressed); | 66 bool UpdateShiftPressed(bool shift_pressed); |
67 | 67 |
68 // Whether we should convert scrolls into pinches. | 68 // Whether we should convert scrolls into pinches. |
69 bool InPinchGestureMode() const; | 69 bool InPinchGestureMode() const; |
70 | 70 |
71 void FillTouchEventAndPoint(const blink::WebMouseEvent& mouse_event); | 71 void FillTouchEventAndPoint(const blink::WebMouseEvent& mouse_event); |
72 void FillPinchEvent(const blink::WebInputEvent& event); | 72 blink::WebGestureEvent GetPinchGestureEvent( |
| 73 blink::WebInputEvent::Type type, |
| 74 const blink::WebInputEvent& original_event); |
73 | 75 |
74 // The following methods generate and pass gesture events to the renderer. | 76 // The following methods generate and pass gesture events to the renderer. |
75 void PinchBegin(const blink::WebGestureEvent& event); | 77 void PinchBegin(const blink::WebGestureEvent& event); |
76 void PinchUpdate(const blink::WebGestureEvent& event); | 78 void PinchUpdate(const blink::WebGestureEvent& event); |
77 void PinchEnd(const blink::WebGestureEvent& event); | 79 void PinchEnd(const blink::WebGestureEvent& event); |
78 void ScrollEnd(const blink::WebGestureEvent& event); | 80 void ScrollEnd(const blink::WebGestureEvent& event); |
79 | 81 |
80 // Offers the emulated event to |gesture_provider_|, conditionally forwarding | 82 // Offers the emulated event to |gesture_provider_|, conditionally forwarding |
81 // it to the client if appropriate. | 83 // it to the client if appropriate. |
82 void HandleEmulatedTouchEvent(blink::WebTouchEvent event); | 84 void HandleEmulatedTouchEvent(blink::WebTouchEvent event); |
(...skipping 24 matching lines...) Expand all Loading... |
107 bool shift_pressed_; | 109 bool shift_pressed_; |
108 | 110 |
109 blink::WebTouchEvent touch_event_; | 111 blink::WebTouchEvent touch_event_; |
110 int emulated_stream_active_sequence_count_; | 112 int emulated_stream_active_sequence_count_; |
111 int native_stream_active_sequence_count_; | 113 int native_stream_active_sequence_count_; |
112 | 114 |
113 // Whether we should suppress next fling cancel. This may happen when we | 115 // Whether we should suppress next fling cancel. This may happen when we |
114 // did not send fling start in pinch mode. | 116 // did not send fling start in pinch mode. |
115 bool suppress_next_fling_cancel_; | 117 bool suppress_next_fling_cancel_; |
116 | 118 |
117 blink::WebGestureEvent pinch_event_; | |
118 // Point which does not move while pinch-zooming. | 119 // Point which does not move while pinch-zooming. |
119 gfx::Point pinch_anchor_; | 120 gfx::Point pinch_anchor_; |
120 // The cumulative scale change from the start of pinch gesture. | 121 // The cumulative scale change from the start of pinch gesture. |
121 float pinch_scale_; | 122 float pinch_scale_; |
122 bool pinch_gesture_active_; | 123 bool pinch_gesture_active_; |
123 | 124 |
124 DISALLOW_COPY_AND_ASSIGN(TouchEmulator); | 125 DISALLOW_COPY_AND_ASSIGN(TouchEmulator); |
125 }; | 126 }; |
126 | 127 |
127 } // namespace content | 128 } // namespace content |
128 | 129 |
129 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_TOUCH_EMULATOR_H_ | 130 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_TOUCH_EMULATOR_H_ |
OLD | NEW |