| 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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 InputHandlerProxy* proxy = it->second->input_handler_proxy(); | 182 InputHandlerProxy* proxy = it->second->input_handler_proxy(); |
| 183 DCHECK(proxy->scroll_elasticity_controller()); | 183 DCHECK(proxy->scroll_elasticity_controller()); |
| 184 proxy->scroll_elasticity_controller()->ObserveGestureEventAndResult( | 184 proxy->scroll_elasticity_controller()->ObserveGestureEventAndResult( |
| 185 gesture_event, scroll_result); | 185 gesture_event, scroll_result); |
| 186 } | 186 } |
| 187 | 187 |
| 188 void InputHandlerManager::NotifyInputEventHandledOnMainThread( | 188 void InputHandlerManager::NotifyInputEventHandledOnMainThread( |
| 189 int routing_id, | 189 int routing_id, |
| 190 blink::WebInputEvent::Type type, | 190 blink::WebInputEvent::Type type, |
| 191 InputEventAckState ack_result) { | 191 InputEventAckState ack_result) { |
| 192 task_runner_->PostTask( | 192 client_->NotifyInputEventHandled(routing_id, type, ack_result); |
| 193 FROM_HERE, | |
| 194 base::Bind( | |
| 195 &InputHandlerManager::NotifyInputEventHandledOnCompositorThread, | |
| 196 base::Unretained(this), routing_id, type, ack_result)); | |
| 197 } | |
| 198 | |
| 199 void InputHandlerManager::NotifyInputEventHandledOnCompositorThread( | |
| 200 int routing_id, | |
| 201 blink::WebInputEvent::Type handled_type, | |
| 202 InputEventAckState ack_result) { | |
| 203 DCHECK(task_runner_->BelongsToCurrentThread()); | |
| 204 auto it = input_handlers_.find(routing_id); | |
| 205 if (it == input_handlers_.end()) | |
| 206 return; | |
| 207 | |
| 208 client_->NotifyInputEventHandled(routing_id, handled_type, ack_result); | |
| 209 } | 193 } |
| 210 | 194 |
| 211 InputEventAckState InputHandlerManager::HandleInputEvent( | 195 InputEventAckState InputHandlerManager::HandleInputEvent( |
| 212 int routing_id, | 196 int routing_id, |
| 213 const WebInputEvent* input_event, | 197 const WebInputEvent* input_event, |
| 214 ui::LatencyInfo* latency_info) { | 198 ui::LatencyInfo* latency_info) { |
| 215 DCHECK(task_runner_->BelongsToCurrentThread()); | 199 DCHECK(task_runner_->BelongsToCurrentThread()); |
| 216 TRACE_EVENT1("input,benchmark", "InputHandlerManager::HandleInputEvent", | 200 TRACE_EVENT1("input,benchmark", "InputHandlerManager::HandleInputEvent", |
| 217 "type", WebInputEventTraits::GetName(input_event->type)); | 201 "type", WebInputEventTraits::GetName(input_event->type)); |
| 218 | 202 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 | 241 |
| 258 void InputHandlerManager::DidStopFlinging(int routing_id) { | 242 void InputHandlerManager::DidStopFlinging(int routing_id) { |
| 259 client_->DidStopFlinging(routing_id); | 243 client_->DidStopFlinging(routing_id); |
| 260 } | 244 } |
| 261 | 245 |
| 262 void InputHandlerManager::DidAnimateForInput() { | 246 void InputHandlerManager::DidAnimateForInput() { |
| 263 renderer_scheduler_->DidAnimateForInputOnCompositorThread(); | 247 renderer_scheduler_->DidAnimateForInputOnCompositorThread(); |
| 264 } | 248 } |
| 265 | 249 |
| 266 } // namespace content | 250 } // namespace content |
| OLD | NEW |