| 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/MouseEventManager.h" | 5 #include "core/input/MouseEventManager.h" |
| 6 | 6 |
| 7 #include "core/clipboard/DataObject.h" | 7 #include "core/clipboard/DataObject.h" |
| 8 #include "core/clipboard/DataTransfer.h" | 8 #include "core/clipboard/DataTransfer.h" |
| 9 #include "core/dom/Element.h" | 9 #include "core/dom/Element.h" |
| 10 #include "core/dom/ElementTraversal.h" | 10 #include "core/dom/ElementTraversal.h" |
| (...skipping 889 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 900 | 900 |
| 901 void MouseEventManager::clearDragDataTransfer() { | 901 void MouseEventManager::clearDragDataTransfer() { |
| 902 if (dragState().m_dragDataTransfer) { | 902 if (dragState().m_dragDataTransfer) { |
| 903 dragState().m_dragDataTransfer->clearDragImage(); | 903 dragState().m_dragDataTransfer->clearDragImage(); |
| 904 dragState().m_dragDataTransfer->setAccessPolicy(DataTransferNumb); | 904 dragState().m_dragDataTransfer->setAccessPolicy(DataTransferNumb); |
| 905 } | 905 } |
| 906 } | 906 } |
| 907 | 907 |
| 908 void MouseEventManager::dragSourceEndedAt(const PlatformMouseEvent& event, | 908 void MouseEventManager::dragSourceEndedAt(const PlatformMouseEvent& event, |
| 909 DragOperation operation) { | 909 DragOperation operation) { |
| 910 // Send a hit test request so that Layer gets a chance to update the :hover | |
| 911 // and :active pseudoclasses.. | |
| 912 HitTestRequest request(HitTestRequest::Release); | |
| 913 EventHandlingUtil::performMouseEventHitTest(m_frame, request, event); | |
| 914 | |
| 915 if (dragState().m_dragSrc) { | 910 if (dragState().m_dragSrc) { |
| 916 dragState().m_dragDataTransfer->setDestinationOperation(operation); | 911 dragState().m_dragDataTransfer->setDestinationOperation(operation); |
| 917 // For now we don't care if event handler cancels default behavior, since | 912 // For now we don't care if event handler cancels default behavior, since |
| 918 // there is none. | 913 // there is none. |
| 919 dispatchDragSrcEvent(EventTypeNames::dragend, event); | 914 dispatchDragSrcEvent(EventTypeNames::dragend, event); |
| 920 } | 915 } |
| 921 clearDragDataTransfer(); | 916 clearDragDataTransfer(); |
| 922 dragState().m_dragSrc = nullptr; | 917 dragState().m_dragSrc = nullptr; |
| 923 // In case the drag was ended due to an escape key press we need to ensure | 918 // In case the drag was ended due to an escape key press we need to ensure |
| 924 // that consecutive mousemove events don't reinitiate the drag and drop. | 919 // that consecutive mousemove events don't reinitiate the drag and drop. |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 999 | 994 |
| 1000 void MouseEventManager::setClickCount(int clickCount) { | 995 void MouseEventManager::setClickCount(int clickCount) { |
| 1001 m_clickCount = clickCount; | 996 m_clickCount = clickCount; |
| 1002 } | 997 } |
| 1003 | 998 |
| 1004 bool MouseEventManager::mouseDownMayStartDrag() { | 999 bool MouseEventManager::mouseDownMayStartDrag() { |
| 1005 return m_mouseDownMayStartDrag; | 1000 return m_mouseDownMayStartDrag; |
| 1006 } | 1001 } |
| 1007 | 1002 |
| 1008 } // namespace blink | 1003 } // namespace blink |
| OLD | NEW |