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

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 an entry to global-interface-listing 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
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 735 matching lines...) Expand 10 before | Expand all | Expand 10 after
746 // the capture. Note that this might be different from 746 // the capture. Note that this might be different from
747 // |m_pointercaptureTarget|. |m_pointercaptureTarget| holds the element 747 // |m_pointercaptureTarget|. |m_pointercaptureTarget| holds the element
748 // that had the capture until now and has been receiving the pointerevents 748 // that had the capture until now and has been receiving the pointerevents
749 // but |m_pendingPointerCaptureTarget| indicated the element that gets the 749 // but |m_pendingPointerCaptureTarget| indicated the element that gets the
750 // very next pointer event. They will be the same if there was no change in 750 // very next pointer event. They will be the same if there was no change in
751 // capturing of a particular |pointerId|. See crbug.com/614481. 751 // capturing of a particular |pointerId|. See crbug.com/614481.
752 if (m_pendingPointerCaptureTarget.get(pointerId) == target) 752 if (m_pendingPointerCaptureTarget.get(pointerId) == target)
753 releasePointerCapture(pointerId); 753 releasePointerCapture(pointerId);
754 } 754 }
755 755
756 bool PointerEventManager::hasPointerCapture(int pointerId, EventTarget* target)
757 {
758 return m_pendingPointerCaptureTarget.get(pointerId) == target;
759 }
760
756 void PointerEventManager::releasePointerCapture(int pointerId) 761 void PointerEventManager::releasePointerCapture(int pointerId)
757 { 762 {
758 m_pendingPointerCaptureTarget.remove(pointerId); 763 m_pendingPointerCaptureTarget.remove(pointerId);
759 } 764 }
760 765
761 bool PointerEventManager::isActive(const int pointerId) const 766 bool PointerEventManager::isActive(const int pointerId) const
762 { 767 {
763 return m_pointerEventFactory.isActive(pointerId); 768 return m_pointerEventFactory.isActive(pointerId);
764 } 769 }
765 770
(...skipping 27 matching lines...) Expand all
793 { 798 {
794 visitor->trace(m_frame); 799 visitor->trace(m_frame);
795 visitor->trace(m_nodeUnderPointer); 800 visitor->trace(m_nodeUnderPointer);
796 visitor->trace(m_pointerCaptureTarget); 801 visitor->trace(m_pointerCaptureTarget);
797 visitor->trace(m_pendingPointerCaptureTarget); 802 visitor->trace(m_pendingPointerCaptureTarget);
798 visitor->trace(m_touchEventManager); 803 visitor->trace(m_touchEventManager);
799 } 804 }
800 805
801 806
802 } // namespace blink 807 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698