OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_INPUT_HANDLER_PROXY_H_ | 5 #ifndef UI_EVENTS_BLINK_INPUT_HANDLER_PROXY_H_ |
6 #define UI_EVENTS_BLINK_INPUT_HANDLER_PROXY_H_ | 6 #define UI_EVENTS_BLINK_INPUT_HANDLER_PROXY_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/containers/hash_tables.h" | 10 #include "base/containers/hash_tables.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 | 55 |
56 InputHandlerProxy(cc::InputHandler* input_handler, | 56 InputHandlerProxy(cc::InputHandler* input_handler, |
57 InputHandlerProxyClient* client); | 57 InputHandlerProxyClient* client); |
58 ~InputHandlerProxy() override; | 58 ~InputHandlerProxy() override; |
59 | 59 |
60 InputScrollElasticityController* scroll_elasticity_controller() { | 60 InputScrollElasticityController* scroll_elasticity_controller() { |
61 return scroll_elasticity_controller_.get(); | 61 return scroll_elasticity_controller_.get(); |
62 } | 62 } |
63 | 63 |
64 void set_smooth_scroll_enabled(bool value) { smooth_scroll_enabled_ = value; } | 64 void set_smooth_scroll_enabled(bool value) { smooth_scroll_enabled_ = value; } |
| 65 void set_touchpad_and_wheel_scroll_latching_enabled(bool value) { |
| 66 touchpad_and_wheel_scroll_latching_enabled_ = value; |
| 67 } |
65 | 68 |
66 enum EventDisposition { | 69 enum EventDisposition { |
67 DID_HANDLE, | 70 DID_HANDLE, |
68 DID_NOT_HANDLE, | 71 DID_NOT_HANDLE, |
69 DID_NOT_HANDLE_NON_BLOCKING_DUE_TO_FLING, | 72 DID_NOT_HANDLE_NON_BLOCKING_DUE_TO_FLING, |
70 DID_HANDLE_NON_BLOCKING, | 73 DID_HANDLE_NON_BLOCKING, |
71 DROP_EVENT | 74 DROP_EVENT |
72 }; | 75 }; |
73 using EventDispositionCallback = | 76 using EventDispositionCallback = |
74 base::Callback<void(EventDisposition, | 77 base::Callback<void(EventDisposition, |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 friend class test::InputHandlerProxyTest; | 123 friend class test::InputHandlerProxyTest; |
121 friend class test::InputHandlerProxyEventQueueTest; | 124 friend class test::InputHandlerProxyEventQueueTest; |
122 | 125 |
123 void DispatchSingleInputEvent(std::unique_ptr<EventWithCallback>, | 126 void DispatchSingleInputEvent(std::unique_ptr<EventWithCallback>, |
124 const base::TimeTicks); | 127 const base::TimeTicks); |
125 void DispatchQueuedInputEvents(); | 128 void DispatchQueuedInputEvents(); |
126 | 129 |
127 // Helper functions for handling more complicated input events. | 130 // Helper functions for handling more complicated input events. |
128 EventDisposition HandleMouseWheel( | 131 EventDisposition HandleMouseWheel( |
129 const blink::WebMouseWheelEvent& event); | 132 const blink::WebMouseWheelEvent& event); |
130 EventDisposition ScrollByMouseWheel( | 133 EventDisposition FlingScrollByMouseWheel( |
131 const blink::WebMouseWheelEvent& event, | 134 const blink::WebMouseWheelEvent& event, |
132 cc::EventListenerProperties listener_properties); | 135 cc::EventListenerProperties listener_properties); |
133 EventDisposition HandleGestureScrollBegin( | 136 EventDisposition HandleGestureScrollBegin( |
134 const blink::WebGestureEvent& event); | 137 const blink::WebGestureEvent& event); |
135 EventDisposition HandleGestureScrollUpdate( | 138 EventDisposition HandleGestureScrollUpdate( |
136 const blink::WebGestureEvent& event); | 139 const blink::WebGestureEvent& event); |
137 EventDisposition HandleGestureScrollEnd( | 140 EventDisposition HandleGestureScrollEnd( |
138 const blink::WebGestureEvent& event); | 141 const blink::WebGestureEvent& event); |
139 EventDisposition HandleGestureFlingStart( | 142 EventDisposition HandleGestureFlingStart( |
140 const blink::WebGestureEvent& event); | 143 const blink::WebGestureEvent& event); |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 | 231 |
229 // Non-zero only within the scope of |scrollBy|. | 232 // Non-zero only within the scope of |scrollBy|. |
230 gfx::Vector2dF current_fling_velocity_; | 233 gfx::Vector2dF current_fling_velocity_; |
231 | 234 |
232 // Used to animate rubber-band over-scroll effect on Mac. | 235 // Used to animate rubber-band over-scroll effect on Mac. |
233 std::unique_ptr<InputScrollElasticityController> | 236 std::unique_ptr<InputScrollElasticityController> |
234 scroll_elasticity_controller_; | 237 scroll_elasticity_controller_; |
235 | 238 |
236 bool smooth_scroll_enabled_; | 239 bool smooth_scroll_enabled_; |
237 bool uma_latency_reporting_enabled_; | 240 bool uma_latency_reporting_enabled_; |
| 241 bool touchpad_and_wheel_scroll_latching_enabled_; |
238 | 242 |
239 // The merged result of the last touch start with previous touch starts. | 243 // The merged result of the last touch start with previous touch starts. |
240 // This value will get returned for subsequent TouchMove events to allow | 244 // This value will get returned for subsequent TouchMove events to allow |
241 // passive events not to block scrolling. | 245 // passive events not to block scrolling. |
242 int32_t touch_start_result_; | 246 int32_t touch_start_result_; |
243 | 247 |
244 base::TimeTicks last_fling_animate_time_; | 248 base::TimeTicks last_fling_animate_time_; |
245 | 249 |
246 // Used to record overscroll notifications while an event is being | 250 // Used to record overscroll notifications while an event is being |
247 // dispatched. If the event causes overscroll, the overscroll metadata can be | 251 // dispatched. If the event causes overscroll, the overscroll metadata can be |
248 // bundled in the event ack, saving an IPC. Note that we must continue | 252 // bundled in the event ack, saving an IPC. Note that we must continue |
249 // supporting overscroll IPC notifications due to fling animation updates. | 253 // supporting overscroll IPC notifications due to fling animation updates. |
250 std::unique_ptr<DidOverscrollParams> current_overscroll_params_; | 254 std::unique_ptr<DidOverscrollParams> current_overscroll_params_; |
251 | 255 |
252 std::unique_ptr<CompositorThreadEventQueue> compositor_event_queue_; | 256 std::unique_ptr<CompositorThreadEventQueue> compositor_event_queue_; |
253 bool has_ongoing_compositor_scroll_pinch_; | 257 bool has_ongoing_compositor_scroll_pinch_; |
254 | 258 |
255 std::unique_ptr<base::TickClock> tick_clock_; | 259 std::unique_ptr<base::TickClock> tick_clock_; |
256 | 260 |
257 DISALLOW_COPY_AND_ASSIGN(InputHandlerProxy); | 261 DISALLOW_COPY_AND_ASSIGN(InputHandlerProxy); |
258 }; | 262 }; |
259 | 263 |
260 } // namespace ui | 264 } // namespace ui |
261 | 265 |
262 #endif // UI_EVENTS_BLINK_INPUT_HANDLER_PROXY_H_ | 266 #endif // UI_EVENTS_BLINK_INPUT_HANDLER_PROXY_H_ |
OLD | NEW |