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> |
| 9 |
8 #include "base/containers/hash_tables.h" | 10 #include "base/containers/hash_tables.h" |
9 #include "base/macros.h" | 11 #include "base/macros.h" |
10 #include "base/memory/scoped_ptr.h" | |
11 #include "cc/input/input_handler.h" | 12 #include "cc/input/input_handler.h" |
12 #include "third_party/WebKit/public/platform/WebGestureCurve.h" | 13 #include "third_party/WebKit/public/platform/WebGestureCurve.h" |
13 #include "third_party/WebKit/public/platform/WebGestureCurveTarget.h" | 14 #include "third_party/WebKit/public/platform/WebGestureCurveTarget.h" |
14 #include "third_party/WebKit/public/web/WebActiveWheelFlingParameters.h" | 15 #include "third_party/WebKit/public/web/WebActiveWheelFlingParameters.h" |
15 #include "third_party/WebKit/public/web/WebInputEvent.h" | 16 #include "third_party/WebKit/public/web/WebInputEvent.h" |
16 #include "ui/events/blink/input_scroll_elasticity_controller.h" | 17 #include "ui/events/blink/input_scroll_elasticity_controller.h" |
17 #include "ui/events/blink/synchronous_input_handler_proxy.h" | 18 #include "ui/events/blink/synchronous_input_handler_proxy.h" |
18 | 19 |
19 namespace ui { | 20 namespace ui { |
20 | 21 |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 const cc::InputHandlerScrollResult& scroll_result); | 145 const cc::InputHandlerScrollResult& scroll_result); |
145 | 146 |
146 // Whether to use a smooth scroll animation for this event. | 147 // Whether to use a smooth scroll animation for this event. |
147 bool ShouldAnimate(bool has_precise_scroll_deltas) const; | 148 bool ShouldAnimate(bool has_precise_scroll_deltas) const; |
148 | 149 |
149 // Update the elastic overscroll controller with |gesture_event|. | 150 // Update the elastic overscroll controller with |gesture_event|. |
150 void HandleScrollElasticityOverscroll( | 151 void HandleScrollElasticityOverscroll( |
151 const blink::WebGestureEvent& gesture_event, | 152 const blink::WebGestureEvent& gesture_event, |
152 const cc::InputHandlerScrollResult& scroll_result); | 153 const cc::InputHandlerScrollResult& scroll_result); |
153 | 154 |
154 scoped_ptr<blink::WebGestureCurve> fling_curve_; | 155 std::unique_ptr<blink::WebGestureCurve> fling_curve_; |
155 // Parameters for the active fling animation, stored in case we need to | 156 // Parameters for the active fling animation, stored in case we need to |
156 // transfer it out later. | 157 // transfer it out later. |
157 blink::WebActiveWheelFlingParameters fling_parameters_; | 158 blink::WebActiveWheelFlingParameters fling_parameters_; |
158 | 159 |
159 InputHandlerProxyClient* client_; | 160 InputHandlerProxyClient* client_; |
160 cc::InputHandler* input_handler_; | 161 cc::InputHandler* input_handler_; |
161 | 162 |
162 // Time at which an active fling should expire due to a deferred cancellation | 163 // Time at which an active fling should expire due to a deferred cancellation |
163 // event. A call to |Animate()| after this time will end the fling. | 164 // event. A call to |Animate()| after this time will end the fling. |
164 double deferred_fling_cancel_time_seconds_; | 165 double deferred_fling_cancel_time_seconds_; |
(...skipping 26 matching lines...) Expand all Loading... |
191 bool disallow_vertical_fling_scroll_; | 192 bool disallow_vertical_fling_scroll_; |
192 | 193 |
193 // Whether an active fling has seen an |Animate()| call. This is useful for | 194 // Whether an active fling has seen an |Animate()| call. This is useful for |
194 // determining if the fling start time should be re-initialized. | 195 // determining if the fling start time should be re-initialized. |
195 bool has_fling_animation_started_; | 196 bool has_fling_animation_started_; |
196 | 197 |
197 // Non-zero only within the scope of |scrollBy|. | 198 // Non-zero only within the scope of |scrollBy|. |
198 gfx::Vector2dF current_fling_velocity_; | 199 gfx::Vector2dF current_fling_velocity_; |
199 | 200 |
200 // Used to animate rubber-band over-scroll effect on Mac. | 201 // Used to animate rubber-band over-scroll effect on Mac. |
201 scoped_ptr<InputScrollElasticityController> scroll_elasticity_controller_; | 202 std::unique_ptr<InputScrollElasticityController> |
| 203 scroll_elasticity_controller_; |
202 | 204 |
203 bool smooth_scroll_enabled_; | 205 bool smooth_scroll_enabled_; |
204 bool uma_latency_reporting_enabled_; | 206 bool uma_latency_reporting_enabled_; |
205 bool use_gesture_events_for_mouse_wheel_; | 207 bool use_gesture_events_for_mouse_wheel_; |
206 | 208 |
207 // The merged result of the last touch start with previous touch starts. | 209 // The merged result of the last touch start with previous touch starts. |
208 // This value will get returned for subsequent TouchMove events to allow | 210 // This value will get returned for subsequent TouchMove events to allow |
209 // passive events not to block scrolling. | 211 // passive events not to block scrolling. |
210 int32_t touch_start_result_; | 212 int32_t touch_start_result_; |
211 | 213 |
212 base::TimeTicks last_fling_animate_time_; | 214 base::TimeTicks last_fling_animate_time_; |
213 | 215 |
214 DISALLOW_COPY_AND_ASSIGN(InputHandlerProxy); | 216 DISALLOW_COPY_AND_ASSIGN(InputHandlerProxy); |
215 }; | 217 }; |
216 | 218 |
217 } // namespace ui | 219 } // namespace ui |
218 | 220 |
219 #endif // UI_EVENTS_BLINK_INPUT_HANDLER_PROXY_H_ | 221 #endif // UI_EVENTS_BLINK_INPUT_HANDLER_PROXY_H_ |
OLD | NEW |