| 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 |
| 910 if (dragState().m_dragSrc) { | 915 if (dragState().m_dragSrc) { |
| 911 dragState().m_dragDataTransfer->setDestinationOperation(operation); | 916 dragState().m_dragDataTransfer->setDestinationOperation(operation); |
| 912 // For now we don't care if event handler cancels default behavior, since | 917 // For now we don't care if event handler cancels default behavior, since |
| 913 // there is none. | 918 // there is none. |
| 914 dispatchDragSrcEvent(EventTypeNames::dragend, event); | 919 dispatchDragSrcEvent(EventTypeNames::dragend, event); |
| 915 } | 920 } |
| 916 clearDragDataTransfer(); | 921 clearDragDataTransfer(); |
| 917 dragState().m_dragSrc = nullptr; | 922 dragState().m_dragSrc = nullptr; |
| 918 // In case the drag was ended due to an escape key press we need to ensure | 923 // In case the drag was ended due to an escape key press we need to ensure |
| 919 // that consecutive mousemove events don't reinitiate the drag and drop. | 924 // that consecutive mousemove events don't reinitiate the drag and drop. |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 994 | 999 |
| 995 void MouseEventManager::setClickCount(int clickCount) { | 1000 void MouseEventManager::setClickCount(int clickCount) { |
| 996 m_clickCount = clickCount; | 1001 m_clickCount = clickCount; |
| 997 } | 1002 } |
| 998 | 1003 |
| 999 bool MouseEventManager::mouseDownMayStartDrag() { | 1004 bool MouseEventManager::mouseDownMayStartDrag() { |
| 1000 return m_mouseDownMayStartDrag; | 1005 return m_mouseDownMayStartDrag; |
| 1001 } | 1006 } |
| 1002 | 1007 |
| 1003 } // namespace blink | 1008 } // namespace blink |
| OLD | NEW |