Chromium Code Reviews| 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/immediate_input_router.h" | 5 #include "content/browser/renderer_host/input/immediate_input_router.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
| 9 #include "content/browser/renderer_host/input/gesture_event_filter.h" | 9 #include "content/browser/renderer_host/input/gesture_event_filter.h" |
| 10 #include "content/browser/renderer_host/input/input_ack_handler.h" | 10 #include "content/browser/renderer_host/input/input_ack_handler.h" |
| (...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 536 if (!coalesced_mouse_wheel_events_.empty()) { | 536 if (!coalesced_mouse_wheel_events_.empty()) { |
| 537 MouseWheelEventWithLatencyInfo next_wheel_event = | 537 MouseWheelEventWithLatencyInfo next_wheel_event = |
| 538 coalesced_mouse_wheel_events_.front(); | 538 coalesced_mouse_wheel_events_.front(); |
| 539 coalesced_mouse_wheel_events_.pop_front(); | 539 coalesced_mouse_wheel_events_.pop_front(); |
| 540 SendWheelEvent(next_wheel_event); | 540 SendWheelEvent(next_wheel_event); |
| 541 } | 541 } |
| 542 } | 542 } |
| 543 | 543 |
| 544 void ImmediateInputRouter::ProcessGestureAck(int type, | 544 void ImmediateInputRouter::ProcessGestureAck(int type, |
| 545 InputEventAckState ack_result) { | 545 InputEventAckState ack_result) { |
| 546 if (GestureEventFilter::IsGestureEventTypeAsync(type)) | |
| 547 return; | |
|
jdduke (slow)
2013/09/30 15:42:56
Are we sure that the |ack_handler_| will never be
tdresser
2013/09/30 18:05:03
I believe this is true. Acks for async event types
| |
| 546 const bool processed = (INPUT_EVENT_ACK_STATE_CONSUMED == ack_result); | 548 const bool processed = (INPUT_EVENT_ACK_STATE_CONSUMED == ack_result); |
| 547 ack_handler_->OnGestureEventAck( | 549 ack_handler_->OnGestureEventAck( |
| 548 gesture_event_filter_->GetGestureEventAwaitingAck(), ack_result); | 550 gesture_event_filter_->GetGestureEventAwaitingAck(), ack_result); |
| 549 gesture_event_filter_->ProcessGestureAck(processed, type); | 551 gesture_event_filter_->ProcessGestureAck(processed, type); |
| 550 } | 552 } |
| 551 | 553 |
| 552 void ImmediateInputRouter::ProcessTouchAck( | 554 void ImmediateInputRouter::ProcessTouchAck( |
| 553 InputEventAckState ack_result, | 555 InputEventAckState ack_result, |
| 554 const ui::LatencyInfo& latency_info) { | 556 const ui::LatencyInfo& latency_info) { |
| 555 // |touch_event_queue_| will forward to OnTouchEventAck when appropriate. | 557 // |touch_event_queue_| will forward to OnTouchEventAck when appropriate. |
| 556 touch_event_queue_->ProcessTouchAck(ack_result, latency_info); | 558 touch_event_queue_->ProcessTouchAck(ack_result, latency_info); |
| 557 } | 559 } |
| 558 | 560 |
| 559 void ImmediateInputRouter::HandleGestureScroll( | 561 void ImmediateInputRouter::HandleGestureScroll( |
| 560 const GestureEventWithLatencyInfo& gesture_event) { | 562 const GestureEventWithLatencyInfo& gesture_event) { |
| 561 if (!enable_no_touch_to_renderer_while_scrolling_) | 563 if (!enable_no_touch_to_renderer_while_scrolling_) |
| 562 return; | 564 return; |
| 563 | 565 |
| 564 // Once scrolling is started stop forwarding touch move events to renderer. | 566 // Once scrolling is started stop forwarding touch move events to renderer. |
| 565 if (gesture_event.event.type == WebInputEvent::GestureScrollBegin) | 567 if (gesture_event.event.type == WebInputEvent::GestureScrollBegin) |
| 566 touch_event_queue_->set_no_touch_move_to_renderer(true); | 568 touch_event_queue_->set_no_touch_move_to_renderer(true); |
| 567 | 569 |
| 568 if (gesture_event.event.type == WebInputEvent::GestureScrollEnd || | 570 if (gesture_event.event.type == WebInputEvent::GestureScrollEnd || |
| 569 gesture_event.event.type == WebInputEvent::GestureFlingStart) { | 571 gesture_event.event.type == WebInputEvent::GestureFlingStart) { |
| 570 touch_event_queue_->set_no_touch_move_to_renderer(false); | 572 touch_event_queue_->set_no_touch_move_to_renderer(false); |
| 571 } | 573 } |
| 572 } | 574 } |
| 573 | 575 |
| 574 } // namespace content | 576 } // namespace content |
| OLD | NEW |