| 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_router_client.h" | 10 #include "content/browser/renderer_host/input/input_router_client.h" |
| (...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 472 = next_mouse_move_.Pass(); | 472 = next_mouse_move_.Pass(); |
| 473 SendMouseEvent(*next_mouse_move); | 473 SendMouseEvent(*next_mouse_move); |
| 474 } | 474 } |
| 475 } else if (WebInputEvent::isKeyboardEventType(type)) { | 475 } else if (WebInputEvent::isKeyboardEventType(type)) { |
| 476 ProcessKeyboardAck(type, ack_result); | 476 ProcessKeyboardAck(type, ack_result); |
| 477 } else if (type == WebInputEvent::MouseWheel) { | 477 } else if (type == WebInputEvent::MouseWheel) { |
| 478 ProcessWheelAck(ack_result); | 478 ProcessWheelAck(ack_result); |
| 479 } else if (WebInputEvent::isTouchEventType(type)) { | 479 } else if (WebInputEvent::isTouchEventType(type)) { |
| 480 ProcessTouchAck(ack_result, latency_info); | 480 ProcessTouchAck(ack_result, latency_info); |
| 481 } else if (WebInputEvent::isGestureEventType(type)) { | 481 } else if (WebInputEvent::isGestureEventType(type)) { |
| 482 ProcessGestureAck(type, ack_result); | 482 ProcessGestureAck(type, ack_result, latency_info); |
| 483 } | 483 } |
| 484 | 484 |
| 485 // WARNING: |this| may be deleted at this point. | 485 // WARNING: |this| may be deleted at this point. |
| 486 | 486 |
| 487 // This is used only for testing, and the other end does not use the | 487 // This is used only for testing, and the other end does not use the |
| 488 // source object. On linux, specifying | 488 // source object. On linux, specifying |
| 489 // Source<RenderWidgetHost> results in a very strange | 489 // Source<RenderWidgetHost> results in a very strange |
| 490 // runtime error in the epilogue of the enclosing | 490 // runtime error in the epilogue of the enclosing |
| 491 // (ProcessInputEventAck) method, but not on other platforms; using | 491 // (ProcessInputEventAck) method, but not on other platforms; using |
| 492 // 'void' instead is just as safe (since NotificationSource | 492 // 'void' instead is just as safe (since NotificationSource |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 534 | 534 |
| 535 // Now send the next (coalesced) mouse wheel event. | 535 // Now send the next (coalesced) mouse wheel event. |
| 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( |
| 545 InputEventAckState ack_result) { | 545 int type, |
| 546 InputEventAckState ack_result, |
| 547 const ui::LatencyInfo& latency_info) { |
| 546 const bool processed = (INPUT_EVENT_ACK_STATE_CONSUMED == ack_result); | 548 const bool processed = (INPUT_EVENT_ACK_STATE_CONSUMED == ack_result); |
| 547 client_->OnGestureEventAck( | 549 client_->OnGestureEventAck(GestureEventWithLatencyInfo( |
| 548 gesture_event_filter_->GetGestureEventAwaitingAck(), ack_result); | 550 gesture_event_filter_->GetGestureEventAwaitingAck(), latency_info), |
| 551 ack_result); |
| 549 gesture_event_filter_->ProcessGestureAck(processed, type); | 552 gesture_event_filter_->ProcessGestureAck(processed, type); |
| 550 } | 553 } |
| 551 | 554 |
| 552 void ImmediateInputRouter::ProcessTouchAck( | 555 void ImmediateInputRouter::ProcessTouchAck( |
| 553 InputEventAckState ack_result, | 556 InputEventAckState ack_result, |
| 554 const ui::LatencyInfo& latency_info) { | 557 const ui::LatencyInfo& latency_info) { |
| 555 // |touch_event_queue_| will forward to OnTouchEventAck when appropriate. | 558 // |touch_event_queue_| will forward to OnTouchEventAck when appropriate. |
| 556 touch_event_queue_->ProcessTouchAck(ack_result, latency_info); | 559 touch_event_queue_->ProcessTouchAck(ack_result, latency_info); |
| 557 } | 560 } |
| 558 | 561 |
| 559 } // namespace content | 562 } // namespace content |
| OLD | NEW |