| 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 918 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 929 MouseEvent::webInputEventModifiersToButtons(event.modifiers()), nullptr, | 929 MouseEvent::webInputEventModifiersToButtons(event.modifiers()), nullptr, |
| 930 TimeTicks::FromSeconds(event.timeStampSeconds()), dataTransfer, | 930 TimeTicks::FromSeconds(event.timeStampSeconds()), dataTransfer, |
| 931 event.fromTouch() ? MouseEvent::FromTouch | 931 event.fromTouch() ? MouseEvent::FromTouch |
| 932 : MouseEvent::RealOrIndistinguishable); | 932 : MouseEvent::RealOrIndistinguishable); |
| 933 | 933 |
| 934 return EventHandlingUtil::toWebInputEventResult( | 934 return EventHandlingUtil::toWebInputEventResult( |
| 935 dragTarget->dispatchEvent(me)); | 935 dragTarget->dispatchEvent(me)); |
| 936 } | 936 } |
| 937 | 937 |
| 938 void MouseEventManager::clearDragDataTransfer() { | 938 void MouseEventManager::clearDragDataTransfer() { |
| 939 if (!m_frame->page()) | |
| 940 return; | |
| 941 if (dragState().m_dragDataTransfer) { | 939 if (dragState().m_dragDataTransfer) { |
| 942 dragState().m_dragDataTransfer->clearDragImage(); | 940 dragState().m_dragDataTransfer->clearDragImage(); |
| 943 dragState().m_dragDataTransfer->setAccessPolicy(DataTransferNumb); | 941 dragState().m_dragDataTransfer->setAccessPolicy(DataTransferNumb); |
| 944 } | 942 } |
| 945 } | 943 } |
| 946 | 944 |
| 947 void MouseEventManager::dragSourceEndedAt(const WebMouseEvent& event, | 945 void MouseEventManager::dragSourceEndedAt(const WebMouseEvent& event, |
| 948 DragOperation operation) { | 946 DragOperation operation) { |
| 949 if (dragState().m_dragSrc) { | 947 if (dragState().m_dragSrc) { |
| 950 dragState().m_dragDataTransfer->setDestinationOperation(operation); | 948 dragState().m_dragDataTransfer->setDestinationOperation(operation); |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1039 | 1037 |
| 1040 void MouseEventManager::setClickCount(int clickCount) { | 1038 void MouseEventManager::setClickCount(int clickCount) { |
| 1041 m_clickCount = clickCount; | 1039 m_clickCount = clickCount; |
| 1042 } | 1040 } |
| 1043 | 1041 |
| 1044 bool MouseEventManager::mouseDownMayStartDrag() { | 1042 bool MouseEventManager::mouseDownMayStartDrag() { |
| 1045 return m_mouseDownMayStartDrag; | 1043 return m_mouseDownMayStartDrag; |
| 1046 } | 1044 } |
| 1047 | 1045 |
| 1048 } // namespace blink | 1046 } // namespace blink |
| OLD | NEW |