Chromium Code Reviews| Index: content/browser/renderer_host/input/input_router_impl.cc |
| diff --git a/content/browser/renderer_host/input/input_router_impl.cc b/content/browser/renderer_host/input/input_router_impl.cc |
| index 54bf892014c80b6884e624cdcdaac312c0817e46..06eadd91c90dc09bc13b78db31ed04901f6ed3cf 100644 |
| --- a/content/browser/renderer_host/input/input_router_impl.cc |
| +++ b/content/browser/renderer_host/input/input_router_impl.cc |
| @@ -248,6 +248,8 @@ bool InputRouterImpl::OnMessageReceived(const IPC::Message& message) { |
| bool handled = true; |
| IPC_BEGIN_MESSAGE_MAP(InputRouterImpl, message) |
| IPC_MESSAGE_HANDLER(InputHostMsg_HandleInputEvent_ACK, OnInputEventAck) |
| + IPC_MESSAGE_HANDLER(InputHostMsg_HandleUncancelableTouchMoveEvent_ACK, |
| + OnUncancelableTouchMoveAck) |
| IPC_MESSAGE_HANDLER(InputHostMsg_DidOverscroll, OnDidOverscroll) |
| IPC_MESSAGE_HANDLER(InputHostMsg_MoveCaret_ACK, OnMsgMoveCaretAck) |
| IPC_MESSAGE_HANDLER(InputHostMsg_SelectRange_ACK, OnSelectMessageAck) |
| @@ -347,13 +349,19 @@ void InputRouterImpl::OfferToHandlers(const WebInputEvent& input_event, |
| // Touch events should always indicate in the event whether they are |
| // cancelable (respect ACK disposition) or not. |
| bool ignores_ack = WebInputEventTraits::IgnoresAckDisposition(input_event); |
| + bool is_async_touch_move = false; |
| if (WebInputEvent::isTouchEventType(input_event.type)) { |
| const WebTouchEvent& touch = static_cast<const WebTouchEvent&>(input_event); |
| - DCHECK_NE(ignores_ack, !!touch.cancelable); |
| + if (touch.type == WebInputEvent::TouchMove && !touch.cancelable) |
| + is_async_touch_move = true; |
| + |
| + if (touch.type != WebInputEvent::TouchMove) |
| + DCHECK_NE(ignores_ack, touch.cancelable); |
| } |
| - // If we don't care about the ack disposition, send the ack immediately. |
| - if (ignores_ack) { |
| + // If we don't care about the ack disposition, or it is an async touchmove |
|
tdresser
2015/03/26 15:25:28
If we identify that uncancelable touchmoves ignore
lanwei
2015/03/27 04:39:41
Done.
|
| + // event, send the ack immediately. |
| + if (ignores_ack || is_async_touch_move) { |
| ProcessInputEventAck(input_event.type, |
| INPUT_EVENT_ACK_STATE_IGNORED, |
| latency_info, |
| @@ -435,6 +443,15 @@ void InputRouterImpl::OnInputEventAck( |
| Details<int>(&type)); |
| } |
| +void InputRouterImpl::OnUncancelableTouchMoveAck( |
| + const InputHostMsg_HandleUncancelableTouchMoveEvent_ACK_Params& ack) { |
| + ProcessUncancelableTouchMoveAck(); |
| + int type = static_cast<int>(WebInputEvent::TouchMove); |
| + NotificationService::current()->Notify( |
| + NOTIFICATION_RENDER_WIDGET_HOST_DID_RECEIVE_INPUT_EVENT_ACK, |
| + Source<void>(this), Details<int>(&type)); |
| +} |
| + |
| void InputRouterImpl::OnDidOverscroll(const DidOverscrollParams& params) { |
| client_->DidOverscroll(params); |
| } |
| @@ -597,6 +614,10 @@ void InputRouterImpl::ProcessTouchAck( |
| touch_event_queue_.ProcessTouchAck(ack_result, latency); |
| } |
| +void InputRouterImpl::ProcessUncancelableTouchMoveAck() { |
|
tdresser
2015/03/26 15:25:28
Do we need a separate method for this?
lanwei
2015/03/27 04:39:41
Done.
|
| + touch_event_queue_.ProcessUncancelableTouchMoveAck(); |
| +} |
| + |
| void InputRouterImpl::UpdateTouchAckTimeoutEnabled() { |
| // Mobile sites tend to be well-behaved with respect to touch handling, so |
| // they have less need for the touch timeout fallback. |