OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/render_widget_host_view_event_handler.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_event_handler.h" |
6 | 6 |
7 #include "base/metrics/user_metrics_action.h" | 7 #include "base/metrics/user_metrics_action.h" |
8 #include "content/browser/renderer_host/input/touch_selection_controller_client_
aura.h" | 8 #include "content/browser/renderer_host/input/touch_selection_controller_client_
aura.h" |
9 #include "content/browser/renderer_host/overscroll_controller.h" | 9 #include "content/browser/renderer_host/overscroll_controller.h" |
10 #include "content/browser/renderer_host/render_view_host_delegate.h" | 10 #include "content/browser/renderer_host/render_view_host_delegate.h" |
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
462 delegate_->selection_controller_client()->OnTouchUp(); | 462 delegate_->selection_controller_client()->OnTouchUp(); |
463 | 463 |
464 // It is important to always mark events as being handled asynchronously when | 464 // It is important to always mark events as being handled asynchronously when |
465 // they are forwarded. This ensures that the current event does not get | 465 // they are forwarded. This ensures that the current event does not get |
466 // processed by the gesture recognizer before events currently awaiting | 466 // processed by the gesture recognizer before events currently awaiting |
467 // dispatch in the touch queue. | 467 // dispatch in the touch queue. |
468 event->DisableSynchronousHandling(); | 468 event->DisableSynchronousHandling(); |
469 | 469 |
470 // Set unchanged touch point to StateStationary for touchmove and | 470 // Set unchanged touch point to StateStationary for touchmove and |
471 // touchcancel to make sure only send one ack per WebTouchEvent. | 471 // touchcancel to make sure only send one ack per WebTouchEvent. |
472 MarkUnchangedTouchPointsAsStationary(&touch_event, event->touch_id()); | 472 MarkUnchangedTouchPointsAsStationary(&touch_event, |
| 473 event->pointer_details().id); |
473 if (ShouldRouteEvent(event)) { | 474 if (ShouldRouteEvent(event)) { |
474 host_->delegate()->GetInputEventRouter()->RouteTouchEvent( | 475 host_->delegate()->GetInputEventRouter()->RouteTouchEvent( |
475 host_view_, &touch_event, *event->latency()); | 476 host_view_, &touch_event, *event->latency()); |
476 } else { | 477 } else { |
477 ProcessTouchEvent(touch_event, *event->latency()); | 478 ProcessTouchEvent(touch_event, *event->latency()); |
478 } | 479 } |
479 } | 480 } |
480 | 481 |
481 void RenderWidgetHostViewEventHandler::OnGestureEvent(ui::GestureEvent* event) { | 482 void RenderWidgetHostViewEventHandler::OnGestureEvent(ui::GestureEvent* event) { |
482 TRACE_EVENT0("input", "RenderWidgetHostViewBase::OnGestureEvent"); | 483 TRACE_EVENT0("input", "RenderWidgetHostViewBase::OnGestureEvent"); |
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
857 host_->ForwardWheelEventWithLatencyInfo(event, latency); | 858 host_->ForwardWheelEventWithLatencyInfo(event, latency); |
858 } | 859 } |
859 | 860 |
860 void RenderWidgetHostViewEventHandler::ProcessTouchEvent( | 861 void RenderWidgetHostViewEventHandler::ProcessTouchEvent( |
861 const blink::WebTouchEvent& event, | 862 const blink::WebTouchEvent& event, |
862 const ui::LatencyInfo& latency) { | 863 const ui::LatencyInfo& latency) { |
863 host_->ForwardTouchEventWithLatencyInfo(event, latency); | 864 host_->ForwardTouchEventWithLatencyInfo(event, latency); |
864 } | 865 } |
865 | 866 |
866 } // namespace content | 867 } // namespace content |
OLD | NEW |