Chromium Code Reviews| Index: content/renderer/render_widget.cc |
| diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc |
| index e3c2602b74c8bdd7d6976db1f6e2ee47f5720cf1..423b3c9d8c9a818fcac2430f8a23317bb6da0f05 100644 |
| --- a/content/renderer/render_widget.cc |
| +++ b/content/renderer/render_widget.cc |
| @@ -1225,12 +1225,31 @@ void RenderWidget::OnHandleInputEvent(const blink::WebInputEvent* input_event, |
| bool no_ack = ignore_ack_for_mouse_move_from_debugger_ && |
| input_event->type == WebInputEvent::MouseMove; |
| if (!WebInputEventTraits::IgnoresAckDisposition(*input_event) && !no_ack) { |
| - InputHostMsg_HandleInputEvent_ACK_Params ack; |
| - ack.type = input_event->type; |
| - ack.state = ack_result; |
| - ack.latency = swap_latency_info; |
| - scoped_ptr<IPC::Message> response( |
| - new InputHostMsg_HandleInputEvent_ACK(routing_id_, ack)); |
| + // Send AsyncTouchEvent_ACK for async touch moves, and InputEvent_ACK for |
| + // all other types of events. |
| + scoped_ptr<IPC::Message> response; |
| + bool is_async_touch_move = false; |
| + if (WebInputEvent::isTouchEventType(input_event->type)) { |
| + const WebTouchEvent& touch = |
| + static_cast<const WebTouchEvent&>(*input_event); |
| + if (touch.type == WebInputEvent::TouchMove && !touch.cancelable) |
|
tdresser
2015/03/25 14:16:18
Can't we just:
if(touch.type == WebInputEvent::Tou
lanwei
2015/03/26 11:54:38
We need to cast to WebTouchEvent.
|
| + is_async_touch_move = true; |
| + } |
| + if (is_async_touch_move) { |
| + InputHostMsg_HandleUncancelableTouchMoveEvent_ACK_Params ack; |
| + ack.type = input_event->type; |
| + response = scoped_ptr<IPC::Message>( |
| + new InputHostMsg_HandleUncancelableTouchMoveEvent_ACK(routing_id_, |
| + ack)); |
| + } else { |
| + InputHostMsg_HandleInputEvent_ACK_Params ack; |
| + ack.type = input_event->type; |
| + ack.state = ack_result; |
| + ack.latency = swap_latency_info; |
| + response = scoped_ptr<IPC::Message>( |
| + new InputHostMsg_HandleInputEvent_ACK(routing_id_, ack)); |
| + } |
| + |
| if (rate_limiting_wanted && frame_pending && !is_hidden_) { |
| // We want to rate limit the input events in this case, so we'll wait for |
| // painting to finish before ACKing this message. |