| 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/DocumentUserGestureToken.h" | 7 #include "core/dom/DocumentUserGestureToken.h" |
| 8 #include "core/dom/ElementTraversal.h" | 8 #include "core/dom/ElementTraversal.h" |
| 9 #include "core/dom/shadow/FlatTreeTraversal.h" | 9 #include "core/dom/shadow/FlatTreeTraversal.h" |
| 10 #include "core/events/MouseEvent.h" | 10 #include "core/events/MouseEvent.h" |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 // Any finger lifting is a user gesture only when it wasn't associated with a | 311 // Any finger lifting is a user gesture only when it wasn't associated with a |
| 312 // scroll. | 312 // scroll. |
| 313 // https://docs.google.com/document/d/1oF1T3O7_E4t1PYHV6gyCwHxOi3ystm0eSL5xZu7
nvOg/edit# | 313 // https://docs.google.com/document/d/1oF1T3O7_E4t1PYHV6gyCwHxOi3ystm0eSL5xZu7
nvOg/edit# |
| 314 // Re-use the same UserGesture for touchend and pointerup (but not for the | 314 // Re-use the same UserGesture for touchend and pointerup (but not for the |
| 315 // mouse events generated by GestureTap). | 315 // mouse events generated by GestureTap). |
| 316 // For the rare case of multi-finger scenarios spanning documents, it | 316 // For the rare case of multi-finger scenarios spanning documents, it |
| 317 // seems extremely unlikely to matter which document the gesture is | 317 // seems extremely unlikely to matter which document the gesture is |
| 318 // associated with so just pick the first finger. | 318 // associated with so just pick the first finger. |
| 319 RefPtr<UserGestureToken> possibleGestureToken; | 319 RefPtr<UserGestureToken> possibleGestureToken; |
| 320 if (event.type() == PlatformEvent::TouchEnd && | 320 if (event.type() == PlatformEvent::TouchEnd && |
| 321 !m_inCanceledStateForPointerTypeTouch) { | 321 !m_inCanceledStateForPointerTypeTouch && !touchInfos.isEmpty() && |
| 322 touchInfos[0].targetFrame) { |
| 322 possibleGestureToken = | 323 possibleGestureToken = |
| 323 DocumentUserGestureToken::create(touchInfos[0].targetFrame->document()); | 324 DocumentUserGestureToken::create(touchInfos[0].targetFrame->document()); |
| 324 } | 325 } |
| 325 UserGestureIndicator holder(possibleGestureToken); | 326 UserGestureIndicator holder(possibleGestureToken); |
| 326 | 327 |
| 327 dispatchTouchPointerEvents(event, touchInfos); | 328 dispatchTouchPointerEvents(event, touchInfos); |
| 328 | 329 |
| 329 return m_touchEventManager->handleTouchEvent(event, touchInfos); | 330 return m_touchEventManager->handleTouchEvent(event, touchInfos); |
| 330 } | 331 } |
| 331 | 332 |
| (...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 718 return true; | 719 return true; |
| 719 } | 720 } |
| 720 return false; | 721 return false; |
| 721 } | 722 } |
| 722 | 723 |
| 723 EventTarget* PointerEventManager::getMouseCapturingNode() { | 724 EventTarget* PointerEventManager::getMouseCapturingNode() { |
| 724 return getCapturingNode(PointerEventFactory::s_mouseId); | 725 return getCapturingNode(PointerEventFactory::s_mouseId); |
| 725 } | 726 } |
| 726 | 727 |
| 727 } // namespace blink | 728 } // namespace blink |
| OLD | NEW |