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 742 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
753 // the capture. Note that this might be different from | 753 // the capture. Note that this might be different from |
754 // |m_pointercaptureTarget|. |m_pointercaptureTarget| holds the element | 754 // |m_pointercaptureTarget|. |m_pointercaptureTarget| holds the element |
755 // that had the capture until now and has been receiving the pointerevents | 755 // that had the capture until now and has been receiving the pointerevents |
756 // but |m_pendingPointerCaptureTarget| indicated the element that gets the | 756 // but |m_pendingPointerCaptureTarget| indicated the element that gets the |
757 // very next pointer event. They will be the same if there was no change in | 757 // very next pointer event. They will be the same if there was no change in |
758 // capturing of a particular |pointerId|. See crbug.com/614481. | 758 // capturing of a particular |pointerId|. See crbug.com/614481. |
759 if (m_pendingPointerCaptureTarget.get(pointerId) == target) | 759 if (m_pendingPointerCaptureTarget.get(pointerId) == target) |
760 releasePointerCapture(pointerId); | 760 releasePointerCapture(pointerId); |
761 } | 761 } |
762 | 762 |
763 bool PointerEventManager::hasPointerCapture(int pointerId, EventTarget* target) | 763 bool PointerEventManager::hasPointerCapture(int pointerId, const EventTarget* ta
rget) const |
764 { | 764 { |
765 return m_pendingPointerCaptureTarget.get(pointerId) == target; | 765 return m_pendingPointerCaptureTarget.get(pointerId) == target; |
766 } | 766 } |
767 | 767 |
768 void PointerEventManager::releasePointerCapture(int pointerId) | 768 void PointerEventManager::releasePointerCapture(int pointerId) |
769 { | 769 { |
770 m_pendingPointerCaptureTarget.remove(pointerId); | 770 m_pendingPointerCaptureTarget.remove(pointerId); |
771 } | 771 } |
772 | 772 |
773 bool PointerEventManager::isActive(const int pointerId) const | 773 bool PointerEventManager::isActive(const int pointerId) const |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
805 { | 805 { |
806 visitor->trace(m_frame); | 806 visitor->trace(m_frame); |
807 visitor->trace(m_nodeUnderPointer); | 807 visitor->trace(m_nodeUnderPointer); |
808 visitor->trace(m_pointerCaptureTarget); | 808 visitor->trace(m_pointerCaptureTarget); |
809 visitor->trace(m_pendingPointerCaptureTarget); | 809 visitor->trace(m_pendingPointerCaptureTarget); |
810 visitor->trace(m_touchEventManager); | 810 visitor->trace(m_touchEventManager); |
811 } | 811 } |
812 | 812 |
813 | 813 |
814 } // namespace blink | 814 } // namespace blink |
OLD | NEW |