| 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 #include "ui/events/blink/input_handler_proxy.h" | 5 #include "ui/events/blink/input_handler_proxy.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 disallow_horizontal_fling_scroll_(false), | 245 disallow_horizontal_fling_scroll_(false), |
| 246 disallow_vertical_fling_scroll_(false), | 246 disallow_vertical_fling_scroll_(false), |
| 247 has_fling_animation_started_(false), | 247 has_fling_animation_started_(false), |
| 248 smooth_scroll_enabled_(false), | 248 smooth_scroll_enabled_(false), |
| 249 uma_latency_reporting_enabled_(base::TimeTicks::IsHighResolution()), | 249 uma_latency_reporting_enabled_(base::TimeTicks::IsHighResolution()), |
| 250 touch_start_result_(kEventDispositionUndefined), | 250 touch_start_result_(kEventDispositionUndefined), |
| 251 current_overscroll_params_(nullptr) { | 251 current_overscroll_params_(nullptr) { |
| 252 DCHECK(client); | 252 DCHECK(client); |
| 253 input_handler_->BindToClient(this); | 253 input_handler_->BindToClient(this); |
| 254 cc::ScrollElasticityHelper* scroll_elasticity_helper = | 254 cc::ScrollElasticityHelper* scroll_elasticity_helper = |
| 255 input_handler_->CreateScrollElasticityHelper(); | 255 input_handler_->CreateRootScrollElasticityHelper(); |
| 256 if (scroll_elasticity_helper) { | 256 if (scroll_elasticity_helper) { |
| 257 scroll_elasticity_controller_.reset( | 257 scroll_elasticity_controller_.reset(new InputScrollElasticityController()); |
| 258 new InputScrollElasticityController(scroll_elasticity_helper)); | 258 scroll_elasticity_controller_->SetActiveHelper( |
| 259 scroll_elasticity_helper->GetWeakPtr()); |
| 259 } | 260 } |
| 260 } | 261 } |
| 261 | 262 |
| 262 InputHandlerProxy::~InputHandlerProxy() {} | 263 InputHandlerProxy::~InputHandlerProxy() {} |
| 263 | 264 |
| 264 void InputHandlerProxy::WillShutdown() { | 265 void InputHandlerProxy::WillShutdown() { |
| 265 scroll_elasticity_controller_.reset(); | 266 scroll_elasticity_controller_.reset(); |
| 266 input_handler_ = NULL; | 267 input_handler_ = NULL; |
| 267 client_->WillShutdown(); | 268 client_->WillShutdown(); |
| 268 } | 269 } |
| (...skipping 1127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1396 // is made asynchronously, to minimize divergence between main thread and | 1397 // is made asynchronously, to minimize divergence between main thread and |
| 1397 // impl thread event handling paths. | 1398 // impl thread event handling paths. |
| 1398 base::ThreadTaskRunnerHandle::Get()->PostTask( | 1399 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 1399 FROM_HERE, | 1400 FROM_HERE, |
| 1400 base::Bind(&InputScrollElasticityController::ObserveGestureEventAndResult, | 1401 base::Bind(&InputScrollElasticityController::ObserveGestureEventAndResult, |
| 1401 scroll_elasticity_controller_->GetWeakPtr(), gesture_event, | 1402 scroll_elasticity_controller_->GetWeakPtr(), gesture_event, |
| 1402 scroll_result)); | 1403 scroll_result)); |
| 1403 } | 1404 } |
| 1404 | 1405 |
| 1405 } // namespace ui | 1406 } // namespace ui |
| OLD | NEW |