| 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 "core/input/PointerEventManager.h" | 5 #include "core/input/PointerEventManager.h" |
| 6 | 6 |
| 7 #include "core/dom/ElementTraversal.h" | 7 #include "core/dom/ElementTraversal.h" |
| 8 #include "core/dom/shadow/FlatTreeTraversal.h" | 8 #include "core/dom/shadow/FlatTreeTraversal.h" |
| 9 #include "core/events/MouseEvent.h" | 9 #include "core/events/MouseEvent.h" |
| 10 #include "core/frame/FrameView.h" | 10 #include "core/frame/FrameView.h" |
| (...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 416 | 416 |
| 417 if (m_inCanceledStateForPointerTypeTouch) | 417 if (m_inCanceledStateForPointerTypeTouch) |
| 418 return; | 418 return; |
| 419 | 419 |
| 420 // Iterate through the touch points, sending PointerEvents to the targets as
required. | 420 // Iterate through the touch points, sending PointerEvents to the targets as
required. |
| 421 for (auto& touchInfo: touchInfos) { | 421 for (auto& touchInfo: touchInfos) { |
| 422 const PlatformTouchPoint &touchPoint = touchInfo.point; | 422 const PlatformTouchPoint &touchPoint = touchInfo.point; |
| 423 WebInputEventResult result = WebInputEventResult::NotHandled; | 423 WebInputEventResult result = WebInputEventResult::NotHandled; |
| 424 // Do not send pointer events for stationary touches. | 424 // Do not send pointer events for stationary touches. |
| 425 if (touchPoint.state() != PlatformTouchPoint::TouchStationary) { | 425 if (touchPoint.state() != PlatformTouchPoint::TouchStationary) { |
| 426 // TODO(crbug.com/608394): The adjustedPagePoint should be converted | |
| 427 // to client coordinates. | |
| 428 PointerEvent* pointerEvent = m_pointerEventFactory.create( | 426 PointerEvent* pointerEvent = m_pointerEventFactory.create( |
| 429 pointerEventNameForTouchPointState(touchPoint.state()), | 427 pointerEventNameForTouchPointState(touchPoint.state()), |
| 430 touchPoint, event.getModifiers(), | 428 touchPoint, event.getModifiers(), |
| 431 touchInfo.adjustedRadius, | 429 touchInfo.adjustedRadius, |
| 432 touchInfo.adjustedPagePoint); | 430 touchInfo.clientPoint); |
| 433 | 431 |
| 434 // Consume the touch point if its pointer event is anything but NotH
andled | 432 // Consume the touch point if its pointer event is anything but NotH
andled |
| 435 // (e.g. preventDefault is called in the listener for the pointer ev
ent). | 433 // (e.g. preventDefault is called in the listener for the pointer ev
ent). |
| 436 result = sendTouchPointerEvent(touchInfo.touchNode, pointerEvent); | 434 result = sendTouchPointerEvent(touchInfo.touchNode, pointerEvent); |
| 437 touchInfo.consumed = result != WebInputEventResult::NotHandled; | 435 touchInfo.consumed = result != WebInputEventResult::NotHandled; |
| 438 } | 436 } |
| 439 } | 437 } |
| 440 } | 438 } |
| 441 | 439 |
| 442 WebInputEventResult PointerEventManager::sendTouchPointerEvent( | 440 WebInputEventResult PointerEventManager::sendTouchPointerEvent( |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 720 { | 718 { |
| 721 visitor->trace(m_frame); | 719 visitor->trace(m_frame); |
| 722 visitor->trace(m_nodeUnderPointer); | 720 visitor->trace(m_nodeUnderPointer); |
| 723 visitor->trace(m_pointerCaptureTarget); | 721 visitor->trace(m_pointerCaptureTarget); |
| 724 visitor->trace(m_pendingPointerCaptureTarget); | 722 visitor->trace(m_pendingPointerCaptureTarget); |
| 725 visitor->trace(m_touchEventManager); | 723 visitor->trace(m_touchEventManager); |
| 726 } | 724 } |
| 727 | 725 |
| 728 | 726 |
| 729 } // namespace blink | 727 } // namespace blink |
| OLD | NEW |