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