OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/gpu/input_handler_manager.h" | 5 #include "content/renderer/gpu/input_handler_manager.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
9 #include "cc/input/input_handler.h" | 9 #include "cc/input/input_handler.h" |
10 #include "content/renderer/gpu/input_event_filter.h" | 10 #include "content/renderer/gpu/input_event_filter.h" |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 if (!input_handler) | 79 if (!input_handler) |
80 return; | 80 return; |
81 | 81 |
82 // The same handler may be registered for a route multiple times. | 82 // The same handler may be registered for a route multiple times. |
83 if (input_handlers_.count(routing_id) != 0) | 83 if (input_handlers_.count(routing_id) != 0) |
84 return; | 84 return; |
85 | 85 |
86 TRACE_EVENT1("input", | 86 TRACE_EVENT1("input", |
87 "InputHandlerManager::AddInputHandlerOnCompositorThread", | 87 "InputHandlerManager::AddInputHandlerOnCompositorThread", |
88 "result", "AddingRoute"); | 88 "result", "AddingRoute"); |
89 client_->DidAddInputHandler(routing_id); | 89 client_->DidAddInputHandler(routing_id, input_handler.get()); |
90 input_handlers_[routing_id] = | 90 input_handlers_[routing_id] = |
91 make_scoped_refptr(new InputHandlerWrapper(this, | 91 make_scoped_refptr(new InputHandlerWrapper(this, |
92 routing_id, main_loop, input_handler, render_view_impl)); | 92 routing_id, main_loop, input_handler, render_view_impl)); |
93 } | 93 } |
94 | 94 |
95 void InputHandlerManager::RemoveInputHandler(int routing_id) { | 95 void InputHandlerManager::RemoveInputHandler(int routing_id) { |
96 DCHECK(message_loop_proxy_->BelongsToCurrentThread()); | 96 DCHECK(message_loop_proxy_->BelongsToCurrentThread()); |
97 | 97 |
98 TRACE_EVENT0("input", "InputHandlerManager::RemoveInputHandler"); | 98 TRACE_EVENT0("input", "InputHandlerManager::RemoveInputHandler"); |
99 | 99 |
(...skipping 14 matching lines...) Expand all Loading... |
114 // Oops, we no longer have an interested input handler.. | 114 // Oops, we no longer have an interested input handler.. |
115 return INPUT_EVENT_ACK_STATE_NOT_CONSUMED; | 115 return INPUT_EVENT_ACK_STATE_NOT_CONSUMED; |
116 } | 116 } |
117 | 117 |
118 InputHandlerProxy* proxy = it->second->input_handler_proxy(); | 118 InputHandlerProxy* proxy = it->second->input_handler_proxy(); |
119 return InputEventDispositionToAck( | 119 return InputEventDispositionToAck( |
120 proxy->HandleInputEventWithLatencyInfo(*input_event, latency_info)); | 120 proxy->HandleInputEventWithLatencyInfo(*input_event, latency_info)); |
121 } | 121 } |
122 | 122 |
123 } // namespace content | 123 } // namespace content |
OLD | NEW |