| 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 694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 705 bool PointerEventManager::isAnyTouchActive() const { | 705 bool PointerEventManager::isAnyTouchActive() const { |
| 706 return m_touchEventManager->isAnyTouchActive(); | 706 return m_touchEventManager->isAnyTouchActive(); |
| 707 } | 707 } |
| 708 | 708 |
| 709 bool PointerEventManager::primaryPointerdownCanceled( | 709 bool PointerEventManager::primaryPointerdownCanceled( |
| 710 uint32_t uniqueTouchEventId) { | 710 uint32_t uniqueTouchEventId) { |
| 711 // It's safe to assume that uniqueTouchEventIds won't wrap back to 0 from | 711 // It's safe to assume that uniqueTouchEventIds won't wrap back to 0 from |
| 712 // 2^32-1 (>4.2 billion): even with a generous 100 unique ids per touch | 712 // 2^32-1 (>4.2 billion): even with a generous 100 unique ids per touch |
| 713 // sequence & one sequence per 10 second, it takes 13+ years to wrap back. | 713 // sequence & one sequence per 10 second, it takes 13+ years to wrap back. |
| 714 while (!m_touchIdsForCanceledPointerdowns.isEmpty()) { | 714 while (!m_touchIdsForCanceledPointerdowns.isEmpty()) { |
| 715 uint32_t firstId = m_touchIdsForCanceledPointerdowns.first(); | 715 uint32_t firstId = m_touchIdsForCanceledPointerdowns.front(); |
| 716 if (firstId > uniqueTouchEventId) | 716 if (firstId > uniqueTouchEventId) |
| 717 return false; | 717 return false; |
| 718 m_touchIdsForCanceledPointerdowns.takeFirst(); | 718 m_touchIdsForCanceledPointerdowns.takeFirst(); |
| 719 if (firstId == uniqueTouchEventId) | 719 if (firstId == uniqueTouchEventId) |
| 720 return true; | 720 return true; |
| 721 } | 721 } |
| 722 return false; | 722 return false; |
| 723 } | 723 } |
| 724 | 724 |
| 725 } // namespace blink | 725 } // namespace blink |
| OLD | NEW |