Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(70)

Side by Side Diff: third_party/WebKit/Source/core/input/PointerEventManager.cpp

Issue 2220043002: Added PointerEvent.hasPointerCapture API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added a missing element interface. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/input/PointerEventManager.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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)
764 {
765 return m_pendingPointerCaptureTarget.get(pointerId) == target;
766 }
767
763 void PointerEventManager::releasePointerCapture(int pointerId) 768 void PointerEventManager::releasePointerCapture(int pointerId)
764 { 769 {
765 m_pendingPointerCaptureTarget.remove(pointerId); 770 m_pendingPointerCaptureTarget.remove(pointerId);
766 } 771 }
767 772
768 bool PointerEventManager::isActive(const int pointerId) const 773 bool PointerEventManager::isActive(const int pointerId) const
769 { 774 {
770 return m_pointerEventFactory.isActive(pointerId); 775 return m_pointerEventFactory.isActive(pointerId);
771 } 776 }
772 777
(...skipping 27 matching lines...) Expand all
800 { 805 {
801 visitor->trace(m_frame); 806 visitor->trace(m_frame);
802 visitor->trace(m_nodeUnderPointer); 807 visitor->trace(m_nodeUnderPointer);
803 visitor->trace(m_pointerCaptureTarget); 808 visitor->trace(m_pointerCaptureTarget);
804 visitor->trace(m_pendingPointerCaptureTarget); 809 visitor->trace(m_pendingPointerCaptureTarget);
805 visitor->trace(m_touchEventManager); 810 visitor->trace(m_touchEventManager);
806 } 811 }
807 812
808 813
809 } // namespace blink 814 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/input/PointerEventManager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698