| 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 883 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 894 if (dragState().m_dragDataTransfer) { | 894 if (dragState().m_dragDataTransfer) { |
| 895 dragState().m_dragDataTransfer->clearDragImage(); | 895 dragState().m_dragDataTransfer->clearDragImage(); |
| 896 dragState().m_dragDataTransfer->setAccessPolicy(DataTransferNumb); | 896 dragState().m_dragDataTransfer->setAccessPolicy(DataTransferNumb); |
| 897 } | 897 } |
| 898 } | 898 } |
| 899 | 899 |
| 900 void MouseEventManager::dragSourceEndedAt(const PlatformMouseEvent& event, | 900 void MouseEventManager::dragSourceEndedAt(const PlatformMouseEvent& event, |
| 901 DragOperation operation) { | 901 DragOperation operation) { |
| 902 if (dragState().m_dragSrc) { | 902 if (dragState().m_dragSrc) { |
| 903 dragState().m_dragDataTransfer->setDestinationOperation(operation); | 903 dragState().m_dragDataTransfer->setDestinationOperation(operation); |
| 904 // For now we don't care if event handler cancels default behavior, since | 904 // The return value is ignored because dragend is not cancelable. |
| 905 // there is none. | |
| 906 dispatchDragSrcEvent(EventTypeNames::dragend, event); | 905 dispatchDragSrcEvent(EventTypeNames::dragend, event); |
| 907 } | 906 } |
| 908 clearDragDataTransfer(); | 907 clearDragDataTransfer(); |
| 909 dragState().m_dragSrc = nullptr; | 908 dragState().m_dragSrc = nullptr; |
| 910 // In case the drag was ended due to an escape key press we need to ensure | 909 // In case the drag was ended due to an escape key press we need to ensure |
| 911 // that consecutive mousemove events don't reinitiate the drag and drop. | 910 // that consecutive mousemove events don't reinitiate the drag and drop. |
| 912 m_mouseDownMayStartDrag = false; | 911 m_mouseDownMayStartDrag = false; |
| 913 } | 912 } |
| 914 | 913 |
| 915 DragState& MouseEventManager::dragState() { | 914 DragState& MouseEventManager::dragState() { |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 987 | 986 |
| 988 void MouseEventManager::setClickCount(int clickCount) { | 987 void MouseEventManager::setClickCount(int clickCount) { |
| 989 m_clickCount = clickCount; | 988 m_clickCount = clickCount; |
| 990 } | 989 } |
| 991 | 990 |
| 992 bool MouseEventManager::mouseDownMayStartDrag() { | 991 bool MouseEventManager::mouseDownMayStartDrag() { |
| 993 return m_mouseDownMayStartDrag; | 992 return m_mouseDownMayStartDrag; |
| 994 } | 993 } |
| 995 | 994 |
| 996 } // namespace blink | 995 } // namespace blink |
| OLD | NEW |