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_event_filter.h" | 5 #include "content/renderer/input/input_event_filter.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 TRACE_EVENT_SCOPE_THREAD); | 166 TRACE_EVENT_SCOPE_THREAD); |
167 IPC::Message new_msg = InputMsg_HandleInputEvent( | 167 IPC::Message new_msg = InputMsg_HandleInputEvent( |
168 routing_id, event, latency_info, is_keyboard_shortcut); | 168 routing_id, event, latency_info, is_keyboard_shortcut); |
169 main_loop_->PostTask( | 169 main_loop_->PostTask( |
170 FROM_HERE, | 170 FROM_HERE, |
171 base::Bind(&InputEventFilter::ForwardToMainListener, | 171 base::Bind(&InputEventFilter::ForwardToMainListener, |
172 this, new_msg)); | 172 this, new_msg)); |
173 return; | 173 return; |
174 } | 174 } |
175 | 175 |
176 if (!WebInputEventTraits::IgnoresAckDisposition(event->type)) | 176 if (!WebInputEventTraits::IgnoresAckDisposition(*event)) |
177 SendACK(event->type, ack, latency_info, routing_id); | 177 SendACK(event->type, ack, latency_info, routing_id); |
178 } | 178 } |
179 | 179 |
180 void InputEventFilter::SendACK(blink::WebInputEvent::Type type, | 180 void InputEventFilter::SendACK(blink::WebInputEvent::Type type, |
181 InputEventAckState ack_result, | 181 InputEventAckState ack_result, |
182 const ui::LatencyInfo& latency_info, | 182 const ui::LatencyInfo& latency_info, |
183 int routing_id) { | 183 int routing_id) { |
184 SendMessage(InputHostMsg_HandleInputEvent_ACK( | 184 SendMessage(InputHostMsg_HandleInputEvent_ACK( |
185 routing_id, type, ack_result, latency_info)); | 185 routing_id, type, ack_result, latency_info)); |
186 } | 186 } |
187 | 187 |
188 void InputEventFilter::SendMessage(const IPC::Message& message) { | 188 void InputEventFilter::SendMessage(const IPC::Message& message) { |
189 DCHECK(target_loop_->BelongsToCurrentThread()); | 189 DCHECK(target_loop_->BelongsToCurrentThread()); |
190 | 190 |
191 io_loop_->PostTask( | 191 io_loop_->PostTask( |
192 FROM_HERE, | 192 FROM_HERE, |
193 base::Bind(&InputEventFilter::SendMessageOnIOThread, this, message)); | 193 base::Bind(&InputEventFilter::SendMessageOnIOThread, this, message)); |
194 } | 194 } |
195 | 195 |
196 void InputEventFilter::SendMessageOnIOThread(const IPC::Message& message) { | 196 void InputEventFilter::SendMessageOnIOThread(const IPC::Message& message) { |
197 DCHECK(io_loop_->BelongsToCurrentThread()); | 197 DCHECK(io_loop_->BelongsToCurrentThread()); |
198 | 198 |
199 if (!sender_) | 199 if (!sender_) |
200 return; // Filter was removed. | 200 return; // Filter was removed. |
201 | 201 |
202 sender_->Send(new IPC::Message(message)); | 202 sender_->Send(new IPC::Message(message)); |
203 } | 203 } |
204 | 204 |
205 } // namespace content | 205 } // namespace content |
OLD | NEW |