| 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 "content/renderer/input/input_handler_manager.h" | 5 #include "content/renderer/input/input_handler_manager.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 | 28 |
| 29 namespace { | 29 namespace { |
| 30 | 30 |
| 31 InputEventAckState InputEventDispositionToAck( | 31 InputEventAckState InputEventDispositionToAck( |
| 32 InputHandlerProxy::EventDisposition disposition) { | 32 InputHandlerProxy::EventDisposition disposition) { |
| 33 switch (disposition) { | 33 switch (disposition) { |
| 34 case InputHandlerProxy::DID_HANDLE: | 34 case InputHandlerProxy::DID_HANDLE: |
| 35 return INPUT_EVENT_ACK_STATE_CONSUMED; | 35 return INPUT_EVENT_ACK_STATE_CONSUMED; |
| 36 case InputHandlerProxy::DID_NOT_HANDLE: | 36 case InputHandlerProxy::DID_NOT_HANDLE: |
| 37 return INPUT_EVENT_ACK_STATE_NOT_CONSUMED; | 37 return INPUT_EVENT_ACK_STATE_NOT_CONSUMED; |
| 38 case InputHandlerProxy::DID_NOT_HANDLE_NON_BLOCKING_DUE_TO_FLING: |
| 39 return INPUT_EVENT_ACK_STATE_SET_NON_BLOCKING_DUE_TO_FLING; |
| 38 case InputHandlerProxy::DROP_EVENT: | 40 case InputHandlerProxy::DROP_EVENT: |
| 39 return INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS; | 41 return INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS; |
| 40 case InputHandlerProxy::DID_HANDLE_NON_BLOCKING: | 42 case InputHandlerProxy::DID_HANDLE_NON_BLOCKING: |
| 41 return INPUT_EVENT_ACK_STATE_SET_NON_BLOCKING; | 43 return INPUT_EVENT_ACK_STATE_SET_NON_BLOCKING; |
| 42 } | 44 } |
| 43 NOTREACHED(); | 45 NOTREACHED(); |
| 44 return INPUT_EVENT_ACK_STATE_UNKNOWN; | 46 return INPUT_EVENT_ACK_STATE_UNKNOWN; |
| 45 } | 47 } |
| 46 | 48 |
| 47 } // namespace | 49 } // namespace |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 } | 251 } |
| 250 callback.Run(input_event_ack_state, std::move(input_event), latency_info, | 252 callback.Run(input_event_ack_state, std::move(input_event), latency_info, |
| 251 std::move(overscroll_params)); | 253 std::move(overscroll_params)); |
| 252 } | 254 } |
| 253 | 255 |
| 254 void InputHandlerManager::DidOverscroll(int routing_id, | 256 void InputHandlerManager::DidOverscroll(int routing_id, |
| 255 const ui::DidOverscrollParams& params) { | 257 const ui::DidOverscrollParams& params) { |
| 256 client_->DidOverscroll(routing_id, params); | 258 client_->DidOverscroll(routing_id, params); |
| 257 } | 259 } |
| 258 | 260 |
| 259 void InputHandlerManager::DidStartFlinging(int routing_id) { | |
| 260 client_->DidStartFlinging(routing_id); | |
| 261 } | |
| 262 | |
| 263 void InputHandlerManager::DidStopFlinging(int routing_id) { | 261 void InputHandlerManager::DidStopFlinging(int routing_id) { |
| 264 client_->DidStopFlinging(routing_id); | 262 client_->DidStopFlinging(routing_id); |
| 265 } | 263 } |
| 266 | 264 |
| 267 void InputHandlerManager::DidAnimateForInput() { | 265 void InputHandlerManager::DidAnimateForInput() { |
| 268 renderer_scheduler_->DidAnimateForInputOnCompositorThread(); | 266 renderer_scheduler_->DidAnimateForInputOnCompositorThread(); |
| 269 } | 267 } |
| 270 | 268 |
| 271 void InputHandlerManager::NeedsMainFrame(int routing_id) { | 269 void InputHandlerManager::NeedsMainFrame(int routing_id) { |
| 272 DCHECK(task_runner_->BelongsToCurrentThread()); | 270 DCHECK(task_runner_->BelongsToCurrentThread()); |
| 273 auto it = input_handlers_.find(routing_id); | 271 auto it = input_handlers_.find(routing_id); |
| 274 if (it == input_handlers_.end()) | 272 if (it == input_handlers_.end()) |
| 275 return; | 273 return; |
| 276 it->second->NeedsMainFrame(); | 274 it->second->NeedsMainFrame(); |
| 277 } | 275 } |
| 278 | 276 |
| 279 void InputHandlerManager::DispatchNonBlockingEventToMainThread( | 277 void InputHandlerManager::DispatchNonBlockingEventToMainThread( |
| 280 int routing_id, | 278 int routing_id, |
| 281 ui::ScopedWebInputEvent event, | 279 ui::ScopedWebInputEvent event, |
| 282 const ui::LatencyInfo& latency_info) { | 280 const ui::LatencyInfo& latency_info) { |
| 283 DCHECK(task_runner_->BelongsToCurrentThread()); | 281 DCHECK(task_runner_->BelongsToCurrentThread()); |
| 284 client_->DispatchNonBlockingEventToMainThread(routing_id, std::move(event), | 282 client_->DispatchNonBlockingEventToMainThread(routing_id, std::move(event), |
| 285 latency_info); | 283 latency_info); |
| 286 } | 284 } |
| 287 | 285 |
| 288 } // namespace content | 286 } // namespace content |
| OLD | NEW |