| 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 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 auto it = input_handlers_.find(routing_id); | 174 auto it = input_handlers_.find(routing_id); |
| 175 if (it == input_handlers_.end()) | 175 if (it == input_handlers_.end()) |
| 176 return; | 176 return; |
| 177 | 177 |
| 178 InputHandlerProxy* proxy = it->second->input_handler_proxy(); | 178 InputHandlerProxy* proxy = it->second->input_handler_proxy(); |
| 179 DCHECK(proxy->scroll_elasticity_controller()); | 179 DCHECK(proxy->scroll_elasticity_controller()); |
| 180 proxy->scroll_elasticity_controller()->ObserveGestureEventAndResult( | 180 proxy->scroll_elasticity_controller()->ObserveGestureEventAndResult( |
| 181 gesture_event, scroll_result); | 181 gesture_event, scroll_result); |
| 182 } | 182 } |
| 183 | 183 |
| 184 void InputHandlerManager::NonBlockingInputEventHandledOnMainThread( | 184 void InputHandlerManager::NotifyInputEventHandledOnMainThread( |
| 185 int routing_id, | 185 int routing_id, |
| 186 blink::WebInputEvent::Type type) { | 186 blink::WebInputEvent::Type type) { |
| 187 task_runner_->PostTask( | 187 task_runner_->PostTask( |
| 188 FROM_HERE, | 188 FROM_HERE, |
| 189 base::Bind( | 189 base::Bind( |
| 190 &InputHandlerManager::NonBlockingInputEventHandledOnCompositorThread, | 190 &InputHandlerManager::NotifyInputEventHandledOnCompositorThread, |
| 191 base::Unretained(this), routing_id, type)); | 191 base::Unretained(this), routing_id, type)); |
| 192 } | 192 } |
| 193 | 193 |
| 194 void InputHandlerManager::NonBlockingInputEventHandledOnCompositorThread( | 194 void InputHandlerManager::NotifyInputEventHandledOnCompositorThread( |
| 195 int routing_id, | 195 int routing_id, |
| 196 blink::WebInputEvent::Type handled_type) { | 196 blink::WebInputEvent::Type handled_type) { |
| 197 DCHECK(task_runner_->BelongsToCurrentThread()); | 197 DCHECK(task_runner_->BelongsToCurrentThread()); |
| 198 auto it = input_handlers_.find(routing_id); | 198 auto it = input_handlers_.find(routing_id); |
| 199 if (it == input_handlers_.end()) | 199 if (it == input_handlers_.end()) |
| 200 return; | 200 return; |
| 201 | 201 |
| 202 client_->NonBlockingInputEventHandled(routing_id, handled_type); | 202 client_->NotifyInputEventHandled(routing_id, handled_type); |
| 203 } | 203 } |
| 204 | 204 |
| 205 InputEventAckState InputHandlerManager::HandleInputEvent( | 205 InputEventAckState InputHandlerManager::HandleInputEvent( |
| 206 int routing_id, | 206 int routing_id, |
| 207 const WebInputEvent* input_event, | 207 const WebInputEvent* input_event, |
| 208 ui::LatencyInfo* latency_info) { | 208 ui::LatencyInfo* latency_info) { |
| 209 DCHECK(task_runner_->BelongsToCurrentThread()); | 209 DCHECK(task_runner_->BelongsToCurrentThread()); |
| 210 TRACE_EVENT1("input,benchmark", "InputHandlerManager::HandleInputEvent", | 210 TRACE_EVENT1("input,benchmark", "InputHandlerManager::HandleInputEvent", |
| 211 "type", WebInputEventTraits::GetName(input_event->type)); | 211 "type", WebInputEventTraits::GetName(input_event->type)); |
| 212 | 212 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 | 247 |
| 248 void InputHandlerManager::DidStopFlinging(int routing_id) { | 248 void InputHandlerManager::DidStopFlinging(int routing_id) { |
| 249 client_->DidStopFlinging(routing_id); | 249 client_->DidStopFlinging(routing_id); |
| 250 } | 250 } |
| 251 | 251 |
| 252 void InputHandlerManager::DidAnimateForInput() { | 252 void InputHandlerManager::DidAnimateForInput() { |
| 253 renderer_scheduler_->DidAnimateForInputOnCompositorThread(); | 253 renderer_scheduler_->DidAnimateForInputOnCompositorThread(); |
| 254 } | 254 } |
| 255 | 255 |
| 256 } // namespace content | 256 } // namespace content |
| OLD | NEW |