Chromium Code Reviews| Index: content/browser/renderer_host/input/immediate_input_router.cc |
| diff --git a/content/browser/renderer_host/input/immediate_input_router.cc b/content/browser/renderer_host/input/immediate_input_router.cc |
| index a52c0ee90428238e9ea58c073bb33c0b28a8a08d..fbfabf3c378e235c3082c1adcb6a33a71a0965db 100644 |
| --- a/content/browser/renderer_host/input/immediate_input_router.cc |
| +++ b/content/browser/renderer_host/input/immediate_input_router.cc |
| @@ -23,6 +23,7 @@ |
| #include "content/public/browser/notification_types.h" |
| #include "content/public/browser/user_metrics.h" |
| #include "content/public/common/content_switches.h" |
| +#include "content/public/common/touch_action.h" |
| #include "ipc/ipc_sender.h" |
| #include "ui/events/event.h" |
| #include "ui/events/keycodes/keyboard_codes.h" |
| @@ -180,6 +181,9 @@ void ImmediateInputRouter::SendKeyboardEvent( |
| void ImmediateInputRouter::SendGestureEvent( |
| const GestureEventWithLatencyInfo& gesture_event) { |
| + if (touch_action_filter_.FilterGestureEvent(gesture_event.event)) |
| + return; |
| + |
| HandleGestureScroll(gesture_event); |
| if (!IsInOverscrollGesture() && |
| @@ -227,6 +231,8 @@ void ImmediateInputRouter::SendTouchEventImmediately( |
| void ImmediateInputRouter::SendGestureEventImmediately( |
| const GestureEventWithLatencyInfo& gesture_event) { |
| + if (touch_action_filter_.FilterGestureEvent(gesture_event.event)) |
|
jdduke (slow)
2013/11/18 15:56:00
Hmm, do you know why |HandleGestureScroll()| is in
Rick Byers
2013/11/19 22:14:59
Ah, I was thinking a gesture event could come in b
|
| + return; |
| HandleGestureScroll(gesture_event); |
| FilterAndSendWebInputEvent(gesture_event.event, gesture_event.latency, false); |
| } |
| @@ -255,6 +261,8 @@ bool ImmediateInputRouter::OnMessageReceived(const IPC::Message& message) { |
| IPC_MESSAGE_HANDLER(ViewHostMsg_SelectRange_ACK, OnSelectRangeAck) |
| IPC_MESSAGE_HANDLER(ViewHostMsg_HasTouchEventHandlers, |
| OnHasTouchEventHandlers) |
| + IPC_MESSAGE_HANDLER(ViewHostMsg_SetTouchAction, |
| + OnSetTouchAction) |
| IPC_MESSAGE_UNHANDLED(handled = false) |
| IPC_END_MESSAGE_MAP() |
| @@ -474,6 +482,16 @@ void ImmediateInputRouter::OnHasTouchEventHandlers(bool has_handlers) { |
| client_->OnHasTouchEventHandlers(has_handlers); |
| } |
| +void ImmediateInputRouter::OnSetTouchAction( |
| + int touch_id, |
| + content::TouchAction touchAction) |
|
jdduke (slow)
2013/11/18 15:56:00
Nit: Brace on same line as closing paren.
sadrul
2013/11/19 10:36:44
touch_action
Rick Byers
2013/11/19 22:14:59
Done.
Rick Byers
2013/11/19 22:14:59
Done.
|
| +{ |
| + // Don't process touch-action messages for synthetic touches we know |
| + // nothing about. |
| + if (touch_event_queue_->IsPendingAckTouchStart(touch_id)) |
| + touch_action_filter_.OnSetTouchAction(touch_id, touchAction); |
| +} |
| + |
| void ImmediateInputRouter::ProcessInputEventAck( |
| WebInputEvent::Type event_type, |
| InputEventAckState ack_result, |