| 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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 auto it = input_handlers_.find(routing_id); | 164 auto it = input_handlers_.find(routing_id); |
| 165 if (it == input_handlers_.end()) | 165 if (it == input_handlers_.end()) |
| 166 return; | 166 return; |
| 167 | 167 |
| 168 InputHandlerProxy* proxy = it->second->input_handler_proxy(); | 168 InputHandlerProxy* proxy = it->second->input_handler_proxy(); |
| 169 DCHECK(proxy->scroll_elasticity_controller()); | 169 DCHECK(proxy->scroll_elasticity_controller()); |
| 170 proxy->scroll_elasticity_controller()->ObserveGestureEventAndResult( | 170 proxy->scroll_elasticity_controller()->ObserveGestureEventAndResult( |
| 171 gesture_event, scroll_result); | 171 gesture_event, scroll_result); |
| 172 } | 172 } |
| 173 | 173 |
| 174 void InputHandlerManager::NonBlockingInputEventHandledOnMainThread( | 174 void InputHandlerManager::NotifyInputEventHandledOnMainThread( |
| 175 int routing_id, | 175 int routing_id, |
| 176 blink::WebInputEvent::Type type) { | 176 blink::WebInputEvent::Type type) { |
| 177 task_runner_->PostTask( | 177 task_runner_->PostTask( |
| 178 FROM_HERE, | 178 FROM_HERE, |
| 179 base::Bind( | 179 base::Bind( |
| 180 &InputHandlerManager::NonBlockingInputEventHandledOnCompositorThread, | 180 &InputHandlerManager::NotifyInputEventHandledOnCompositorThread, |
| 181 base::Unretained(this), routing_id, type)); | 181 base::Unretained(this), routing_id, type)); |
| 182 } | 182 } |
| 183 | 183 |
| 184 void InputHandlerManager::NonBlockingInputEventHandledOnCompositorThread( | 184 void InputHandlerManager::NotifyInputEventHandledOnCompositorThread( |
| 185 int routing_id, | 185 int routing_id, |
| 186 blink::WebInputEvent::Type handled_type) { | 186 blink::WebInputEvent::Type handled_type) { |
| 187 DCHECK(task_runner_->BelongsToCurrentThread()); | 187 DCHECK(task_runner_->BelongsToCurrentThread()); |
| 188 auto it = input_handlers_.find(routing_id); | 188 auto it = input_handlers_.find(routing_id); |
| 189 if (it == input_handlers_.end()) | 189 if (it == input_handlers_.end()) |
| 190 return; | 190 return; |
| 191 | 191 |
| 192 client_->NonBlockingInputEventHandled(routing_id, handled_type); | 192 client_->NotifyInputEventHandled(routing_id, handled_type); |
| 193 } | 193 } |
| 194 | 194 |
| 195 InputEventAckState InputHandlerManager::HandleInputEvent( | 195 InputEventAckState InputHandlerManager::HandleInputEvent( |
| 196 int routing_id, | 196 int routing_id, |
| 197 const WebInputEvent* input_event, | 197 const WebInputEvent* input_event, |
| 198 ui::LatencyInfo* latency_info) { | 198 ui::LatencyInfo* latency_info) { |
| 199 DCHECK(task_runner_->BelongsToCurrentThread()); | 199 DCHECK(task_runner_->BelongsToCurrentThread()); |
| 200 TRACE_EVENT1("input,benchmark", "InputHandlerManager::HandleInputEvent", | 200 TRACE_EVENT1("input,benchmark", "InputHandlerManager::HandleInputEvent", |
| 201 "type", WebInputEventTraits::GetName(input_event->type)); | 201 "type", WebInputEventTraits::GetName(input_event->type)); |
| 202 | 202 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 | 237 |
| 238 void InputHandlerManager::DidStopFlinging(int routing_id) { | 238 void InputHandlerManager::DidStopFlinging(int routing_id) { |
| 239 client_->DidStopFlinging(routing_id); | 239 client_->DidStopFlinging(routing_id); |
| 240 } | 240 } |
| 241 | 241 |
| 242 void InputHandlerManager::DidAnimateForInput() { | 242 void InputHandlerManager::DidAnimateForInput() { |
| 243 renderer_scheduler_->DidAnimateForInputOnCompositorThread(); | 243 renderer_scheduler_->DidAnimateForInputOnCompositorThread(); |
| 244 } | 244 } |
| 245 | 245 |
| 246 } // namespace content | 246 } // namespace content |
| OLD | NEW |