| 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 "base/containers/hash_tables.h" | 8 #include "base/containers/hash_tables.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 | 39 |
| 40 InputHandlerProxy(cc::InputHandler* input_handler, | 40 InputHandlerProxy(cc::InputHandler* input_handler, |
| 41 InputHandlerProxyClient* client); | 41 InputHandlerProxyClient* client); |
| 42 ~InputHandlerProxy() override; | 42 ~InputHandlerProxy() override; |
| 43 | 43 |
| 44 InputScrollElasticityController* scroll_elasticity_controller() { | 44 InputScrollElasticityController* scroll_elasticity_controller() { |
| 45 return scroll_elasticity_controller_.get(); | 45 return scroll_elasticity_controller_.get(); |
| 46 } | 46 } |
| 47 | 47 |
| 48 void set_smooth_scroll_enabled(bool value) { smooth_scroll_enabled_ = value; } | 48 void set_smooth_scroll_enabled(bool value) { smooth_scroll_enabled_ = value; } |
| 49 void set_gesture_events_for_mouse_wheel(bool value) { |
| 50 gesture_events_for_mouse_wheel_ = value; |
| 51 } |
| 49 | 52 |
| 50 enum EventDisposition { | 53 enum EventDisposition { |
| 51 DID_HANDLE, | 54 DID_HANDLE, |
| 52 DID_NOT_HANDLE, | 55 DID_NOT_HANDLE, |
| 56 NON_BLOCKING, |
| 53 DROP_EVENT | 57 DROP_EVENT |
| 54 }; | 58 }; |
| 55 EventDisposition HandleInputEventWithLatencyInfo( | 59 EventDisposition HandleInputEventWithLatencyInfo( |
| 56 const blink::WebInputEvent& event, | 60 const blink::WebInputEvent& event, |
| 57 ui::LatencyInfo* latency_info); | 61 ui::LatencyInfo* latency_info); |
| 58 EventDisposition HandleInputEvent(const blink::WebInputEvent& event); | 62 EventDisposition HandleInputEvent(const blink::WebInputEvent& event); |
| 59 | 63 |
| 60 // cc::InputHandlerClient implementation. | 64 // cc::InputHandlerClient implementation. |
| 61 void WillShutdown() override; | 65 void WillShutdown() override; |
| 62 void Animate(base::TimeTicks time) override; | 66 void Animate(base::TimeTicks time) override; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 84 bool gesture_scroll_on_impl_thread_for_testing() const { | 88 bool gesture_scroll_on_impl_thread_for_testing() const { |
| 85 return gesture_scroll_on_impl_thread_; | 89 return gesture_scroll_on_impl_thread_; |
| 86 } | 90 } |
| 87 | 91 |
| 88 private: | 92 private: |
| 89 friend class test::InputHandlerProxyTest; | 93 friend class test::InputHandlerProxyTest; |
| 90 | 94 |
| 91 // Helper functions for handling more complicated input events. | 95 // Helper functions for handling more complicated input events. |
| 92 EventDisposition HandleMouseWheel( | 96 EventDisposition HandleMouseWheel( |
| 93 const blink::WebMouseWheelEvent& event); | 97 const blink::WebMouseWheelEvent& event); |
| 98 EventDisposition ScrollByMouseWheel(const blink::WebMouseWheelEvent& event); |
| 94 EventDisposition HandleGestureScrollBegin( | 99 EventDisposition HandleGestureScrollBegin( |
| 95 const blink::WebGestureEvent& event); | 100 const blink::WebGestureEvent& event); |
| 96 EventDisposition HandleGestureScrollUpdate( | 101 EventDisposition HandleGestureScrollUpdate( |
| 97 const blink::WebGestureEvent& event); | 102 const blink::WebGestureEvent& event); |
| 98 EventDisposition HandleGestureScrollEnd( | 103 EventDisposition HandleGestureScrollEnd( |
| 99 const blink::WebGestureEvent& event); | 104 const blink::WebGestureEvent& event); |
| 100 EventDisposition HandleGestureFlingStart( | 105 EventDisposition HandleGestureFlingStart( |
| 101 const blink::WebGestureEvent& event); | 106 const blink::WebGestureEvent& event); |
| 102 EventDisposition HandleTouchStart( | 107 EventDisposition HandleTouchStart(const blink::WebTouchEvent& event); |
| 103 const blink::WebTouchEvent& event); | 108 EventDisposition HandleTouchMove(const blink::WebTouchEvent& event); |
| 104 | 109 |
| 105 // Returns true if the event should be suppressed due to to an active, | 110 // Returns true if the event should be suppressed due to to an active, |
| 106 // boost-enabled fling, in which case further processing should cease. | 111 // boost-enabled fling, in which case further processing should cease. |
| 107 bool FilterInputEventForFlingBoosting(const blink::WebInputEvent& event); | 112 bool FilterInputEventForFlingBoosting(const blink::WebInputEvent& event); |
| 108 | 113 |
| 109 // Schedule a time in the future after which a boost-enabled fling will | 114 // Schedule a time in the future after which a boost-enabled fling will |
| 110 // terminate without further momentum from the user (see |Animate()|). | 115 // terminate without further momentum from the user (see |Animate()|). |
| 111 void ExtendBoostedFlingTimeout(const blink::WebGestureEvent& event); | 116 void ExtendBoostedFlingTimeout(const blink::WebGestureEvent& event); |
| 112 | 117 |
| 113 // Returns true if we scrolled by the increment. | 118 // Returns true if we scrolled by the increment. |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 // Non-zero only within the scope of |scrollBy|. | 185 // Non-zero only within the scope of |scrollBy|. |
| 181 gfx::Vector2dF current_fling_velocity_; | 186 gfx::Vector2dF current_fling_velocity_; |
| 182 | 187 |
| 183 // Used to animate rubber-band over-scroll effect on Mac. | 188 // Used to animate rubber-band over-scroll effect on Mac. |
| 184 scoped_ptr<InputScrollElasticityController> scroll_elasticity_controller_; | 189 scoped_ptr<InputScrollElasticityController> scroll_elasticity_controller_; |
| 185 | 190 |
| 186 bool smooth_scroll_enabled_; | 191 bool smooth_scroll_enabled_; |
| 187 | 192 |
| 188 bool uma_latency_reporting_enabled_; | 193 bool uma_latency_reporting_enabled_; |
| 189 | 194 |
| 195 bool gesture_events_for_mouse_wheel_; |
| 196 |
| 190 base::TimeTicks last_fling_animate_time_; | 197 base::TimeTicks last_fling_animate_time_; |
| 191 | 198 |
| 192 DISALLOW_COPY_AND_ASSIGN(InputHandlerProxy); | 199 DISALLOW_COPY_AND_ASSIGN(InputHandlerProxy); |
| 193 }; | 200 }; |
| 194 | 201 |
| 195 } // namespace ui | 202 } // namespace ui |
| 196 | 203 |
| 197 #endif // UI_EVENTS_BLINK_INPUT_HANDLER_PROXY_H_ | 204 #endif // UI_EVENTS_BLINK_INPUT_HANDLER_PROXY_H_ |
| OLD | NEW |