| 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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 return; | 209 return; |
| 210 | 210 |
| 211 InputHandlerProxy* proxy = it->second->input_handler_proxy(); | 211 InputHandlerProxy* proxy = it->second->input_handler_proxy(); |
| 212 DCHECK(proxy->scroll_elasticity_controller()); | 212 DCHECK(proxy->scroll_elasticity_controller()); |
| 213 proxy->scroll_elasticity_controller()->ObserveGestureEventAndResult( | 213 proxy->scroll_elasticity_controller()->ObserveGestureEventAndResult( |
| 214 gesture_event, scroll_result); | 214 gesture_event, scroll_result); |
| 215 } | 215 } |
| 216 | 216 |
| 217 void InputHandlerManager::NotifyInputEventHandledOnMainThread( | 217 void InputHandlerManager::NotifyInputEventHandledOnMainThread( |
| 218 int routing_id, | 218 int routing_id, |
| 219 blink::WebInputEvent::Type type) { | 219 blink::WebInputEvent::Type type, |
| 220 InputEventAckState ack_result) { |
| 220 task_runner_->PostTask( | 221 task_runner_->PostTask( |
| 221 FROM_HERE, | 222 FROM_HERE, |
| 222 base::Bind( | 223 base::Bind( |
| 223 &InputHandlerManager::NotifyInputEventHandledOnCompositorThread, | 224 &InputHandlerManager::NotifyInputEventHandledOnCompositorThread, |
| 224 base::Unretained(this), routing_id, type)); | 225 base::Unretained(this), routing_id, type, ack_result)); |
| 225 } | 226 } |
| 226 | 227 |
| 227 void InputHandlerManager::NotifyInputEventHandledOnCompositorThread( | 228 void InputHandlerManager::NotifyInputEventHandledOnCompositorThread( |
| 228 int routing_id, | 229 int routing_id, |
| 229 blink::WebInputEvent::Type handled_type) { | 230 blink::WebInputEvent::Type handled_type, |
| 231 InputEventAckState ack_result) { |
| 230 DCHECK(task_runner_->BelongsToCurrentThread()); | 232 DCHECK(task_runner_->BelongsToCurrentThread()); |
| 231 auto it = input_handlers_.find(routing_id); | 233 auto it = input_handlers_.find(routing_id); |
| 232 if (it == input_handlers_.end()) | 234 if (it == input_handlers_.end()) |
| 233 return; | 235 return; |
| 234 | 236 |
| 235 client_->NotifyInputEventHandled(routing_id, handled_type); | 237 client_->NotifyInputEventHandled(routing_id, handled_type, ack_result); |
| 236 } | 238 } |
| 237 | 239 |
| 238 InputEventAckState InputHandlerManager::HandleInputEvent( | 240 InputEventAckState InputHandlerManager::HandleInputEvent( |
| 239 int routing_id, | 241 int routing_id, |
| 240 const WebInputEvent* input_event, | 242 const WebInputEvent* input_event, |
| 241 ui::LatencyInfo* latency_info) { | 243 ui::LatencyInfo* latency_info) { |
| 242 DCHECK(task_runner_->BelongsToCurrentThread()); | 244 DCHECK(task_runner_->BelongsToCurrentThread()); |
| 243 TRACE_EVENT1("input,benchmark", "InputHandlerManager::HandleInputEvent", | 245 TRACE_EVENT1("input,benchmark", "InputHandlerManager::HandleInputEvent", |
| 244 "type", WebInputEventTraits::GetName(input_event->type)); | 246 "type", WebInputEventTraits::GetName(input_event->type)); |
| 245 | 247 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 | 286 |
| 285 void InputHandlerManager::DidStopFlinging(int routing_id) { | 287 void InputHandlerManager::DidStopFlinging(int routing_id) { |
| 286 client_->DidStopFlinging(routing_id); | 288 client_->DidStopFlinging(routing_id); |
| 287 } | 289 } |
| 288 | 290 |
| 289 void InputHandlerManager::DidAnimateForInput() { | 291 void InputHandlerManager::DidAnimateForInput() { |
| 290 renderer_scheduler_->DidAnimateForInputOnCompositorThread(); | 292 renderer_scheduler_->DidAnimateForInputOnCompositorThread(); |
| 291 } | 293 } |
| 292 | 294 |
| 293 } // namespace content | 295 } // namespace content |
| OLD | NEW |