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/browser/renderer_host/input/input_router_impl.h" | 5 #include "content/browser/renderer_host/input/input_router_impl.h" |
6 | 6 |
7 #include <math.h> | 7 #include <math.h> |
8 | 8 |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 const GestureEventWithLatencyInfo& gesture_event) { | 230 const GestureEventWithLatencyInfo& gesture_event) { |
231 FilterAndSendWebInputEvent(gesture_event.event, gesture_event.latency, false); | 231 FilterAndSendWebInputEvent(gesture_event.event, gesture_event.latency, false); |
232 } | 232 } |
233 | 233 |
234 const NativeWebKeyboardEvent* InputRouterImpl::GetLastKeyboardEvent() const { | 234 const NativeWebKeyboardEvent* InputRouterImpl::GetLastKeyboardEvent() const { |
235 if (key_queue_.empty()) | 235 if (key_queue_.empty()) |
236 return NULL; | 236 return NULL; |
237 return &key_queue_.front(); | 237 return &key_queue_.front(); |
238 } | 238 } |
239 | 239 |
240 bool InputRouterImpl::ShouldForwardTouchEvent() const { | |
241 // Always send a touch event if the renderer has a touch-event handler or | |
242 // there are pending touch events. | |
243 return touch_event_queue_.has_handlers() || !touch_event_queue_.empty(); | |
244 } | |
245 | |
246 void InputRouterImpl::OnViewUpdated(int view_flags) { | 240 void InputRouterImpl::OnViewUpdated(int view_flags) { |
247 current_view_flags_ = view_flags; | 241 current_view_flags_ = view_flags; |
248 | 242 |
249 // A fixed page scale or mobile viewport should disable the touch ack timeout. | 243 // A fixed page scale or mobile viewport should disable the touch ack timeout. |
250 UpdateTouchAckTimeoutEnabled(); | 244 UpdateTouchAckTimeoutEnabled(); |
251 } | 245 } |
252 | 246 |
253 bool InputRouterImpl::OnMessageReceived(const IPC::Message& message) { | 247 bool InputRouterImpl::OnMessageReceived(const IPC::Message& message) { |
254 bool handled = true; | 248 bool handled = true; |
255 IPC_BEGIN_MESSAGE_MAP(InputRouterImpl, message) | 249 IPC_BEGIN_MESSAGE_MAP(InputRouterImpl, message) |
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
636 return !touch_event_queue_.empty() || | 630 return !touch_event_queue_.empty() || |
637 !gesture_event_queue_.empty() || | 631 !gesture_event_queue_.empty() || |
638 !key_queue_.empty() || | 632 !key_queue_.empty() || |
639 mouse_move_pending_ || | 633 mouse_move_pending_ || |
640 mouse_wheel_pending_ || | 634 mouse_wheel_pending_ || |
641 select_message_pending_ || | 635 select_message_pending_ || |
642 move_caret_pending_; | 636 move_caret_pending_; |
643 } | 637 } |
644 | 638 |
645 } // namespace content | 639 } // namespace content |
OLD | NEW |