| 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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 base::Unretained(this), routing_id)); | 152 base::Unretained(this), routing_id)); |
| 153 } | 153 } |
| 154 } | 154 } |
| 155 | 155 |
| 156 void InputHandlerManager::UnregisterRoutingIDOnCompositorThread( | 156 void InputHandlerManager::UnregisterRoutingIDOnCompositorThread( |
| 157 int routing_id) { | 157 int routing_id) { |
| 158 DCHECK(task_runner_->BelongsToCurrentThread()); | 158 DCHECK(task_runner_->BelongsToCurrentThread()); |
| 159 client_->UnregisterRoutingID(routing_id); | 159 client_->UnregisterRoutingID(routing_id); |
| 160 } | 160 } |
| 161 | 161 |
| 162 void InputHandlerManager::ObserveWheelEventAndResultOnMainThread( | |
| 163 int routing_id, | |
| 164 const blink::WebMouseWheelEvent& wheel_event, | |
| 165 const cc::InputHandlerScrollResult& scroll_result) { | |
| 166 task_runner_->PostTask( | |
| 167 FROM_HERE, | |
| 168 base::Bind( | |
| 169 &InputHandlerManager::ObserveWheelEventAndResultOnCompositorThread, | |
| 170 base::Unretained(this), routing_id, wheel_event, scroll_result)); | |
| 171 } | |
| 172 | |
| 173 void InputHandlerManager::ObserveWheelEventAndResultOnCompositorThread( | |
| 174 int routing_id, | |
| 175 const blink::WebMouseWheelEvent& wheel_event, | |
| 176 const cc::InputHandlerScrollResult& scroll_result) { | |
| 177 DCHECK(task_runner_->BelongsToCurrentThread()); | |
| 178 auto it = input_handlers_.find(routing_id); | |
| 179 if (it == input_handlers_.end()) | |
| 180 return; | |
| 181 | |
| 182 InputHandlerProxy* proxy = it->second->input_handler_proxy(); | |
| 183 DCHECK(proxy->scroll_elasticity_controller()); | |
| 184 proxy->scroll_elasticity_controller()->ObserveWheelEventAndResult( | |
| 185 wheel_event, scroll_result); | |
| 186 } | |
| 187 | |
| 188 void InputHandlerManager::ObserveGestureEventAndResultOnMainThread( | 162 void InputHandlerManager::ObserveGestureEventAndResultOnMainThread( |
| 189 int routing_id, | 163 int routing_id, |
| 190 const blink::WebGestureEvent& gesture_event, | 164 const blink::WebGestureEvent& gesture_event, |
| 191 const cc::InputHandlerScrollResult& scroll_result) { | 165 const cc::InputHandlerScrollResult& scroll_result) { |
| 192 task_runner_->PostTask( | 166 task_runner_->PostTask( |
| 193 FROM_HERE, | 167 FROM_HERE, |
| 194 base::Bind( | 168 base::Bind( |
| 195 &InputHandlerManager::ObserveGestureEventAndResultOnCompositorThread, | 169 &InputHandlerManager::ObserveGestureEventAndResultOnCompositorThread, |
| 196 base::Unretained(this), routing_id, gesture_event, scroll_result)); | 170 base::Unretained(this), routing_id, gesture_event, scroll_result)); |
| 197 } | 171 } |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 | 255 |
| 282 void InputHandlerManager::DidStopFlinging(int routing_id) { | 256 void InputHandlerManager::DidStopFlinging(int routing_id) { |
| 283 client_->DidStopFlinging(routing_id); | 257 client_->DidStopFlinging(routing_id); |
| 284 } | 258 } |
| 285 | 259 |
| 286 void InputHandlerManager::DidAnimateForInput() { | 260 void InputHandlerManager::DidAnimateForInput() { |
| 287 renderer_scheduler_->DidAnimateForInputOnCompositorThread(); | 261 renderer_scheduler_->DidAnimateForInputOnCompositorThread(); |
| 288 } | 262 } |
| 289 | 263 |
| 290 } // namespace content | 264 } // namespace content |
| OLD | NEW |