| 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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 return; | 180 return; |
| 181 | 181 |
| 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 task_runner_->PostTask( | 192 task_runner_->PostTask( |
| 192 FROM_HERE, | 193 FROM_HERE, |
| 193 base::Bind( | 194 base::Bind( |
| 194 &InputHandlerManager::NotifyInputEventHandledOnCompositorThread, | 195 &InputHandlerManager::NotifyInputEventHandledOnCompositorThread, |
| 195 base::Unretained(this), routing_id, type)); | 196 base::Unretained(this), routing_id, type, ack_result)); |
| 196 } | 197 } |
| 197 | 198 |
| 198 void InputHandlerManager::NotifyInputEventHandledOnCompositorThread( | 199 void InputHandlerManager::NotifyInputEventHandledOnCompositorThread( |
| 199 int routing_id, | 200 int routing_id, |
| 200 blink::WebInputEvent::Type handled_type) { | 201 blink::WebInputEvent::Type handled_type, |
| 202 InputEventAckState ack_result) { |
| 201 DCHECK(task_runner_->BelongsToCurrentThread()); | 203 DCHECK(task_runner_->BelongsToCurrentThread()); |
| 202 auto it = input_handlers_.find(routing_id); | 204 auto it = input_handlers_.find(routing_id); |
| 203 if (it == input_handlers_.end()) | 205 if (it == input_handlers_.end()) |
| 204 return; | 206 return; |
| 205 | 207 |
| 206 client_->NotifyInputEventHandled(routing_id, handled_type); | 208 client_->NotifyInputEventHandled(routing_id, handled_type, ack_result); |
| 207 } | 209 } |
| 208 | 210 |
| 209 InputEventAckState InputHandlerManager::HandleInputEvent( | 211 InputEventAckState InputHandlerManager::HandleInputEvent( |
| 210 int routing_id, | 212 int routing_id, |
| 211 const WebInputEvent* input_event, | 213 const WebInputEvent* input_event, |
| 212 ui::LatencyInfo* latency_info) { | 214 ui::LatencyInfo* latency_info) { |
| 213 DCHECK(task_runner_->BelongsToCurrentThread()); | 215 DCHECK(task_runner_->BelongsToCurrentThread()); |
| 214 TRACE_EVENT1("input,benchmark", "InputHandlerManager::HandleInputEvent", | 216 TRACE_EVENT1("input,benchmark", "InputHandlerManager::HandleInputEvent", |
| 215 "type", WebInputEventTraits::GetName(input_event->type)); | 217 "type", WebInputEventTraits::GetName(input_event->type)); |
| 216 | 218 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 | 257 |
| 256 void InputHandlerManager::DidStopFlinging(int routing_id) { | 258 void InputHandlerManager::DidStopFlinging(int routing_id) { |
| 257 client_->DidStopFlinging(routing_id); | 259 client_->DidStopFlinging(routing_id); |
| 258 } | 260 } |
| 259 | 261 |
| 260 void InputHandlerManager::DidAnimateForInput() { | 262 void InputHandlerManager::DidAnimateForInput() { |
| 261 renderer_scheduler_->DidAnimateForInputOnCompositorThread(); | 263 renderer_scheduler_->DidAnimateForInputOnCompositorThread(); |
| 262 } | 264 } |
| 263 | 265 |
| 264 } // namespace content | 266 } // namespace content |
| OLD | NEW |