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 927 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
938 MouseEvent::webInputEventModifiersToButtons(event.modifiers()), nullptr, | 938 MouseEvent::webInputEventModifiersToButtons(event.modifiers()), nullptr, |
939 TimeTicks::FromSeconds(event.timeStampSeconds()), dataTransfer, | 939 TimeTicks::FromSeconds(event.timeStampSeconds()), dataTransfer, |
940 event.fromTouch() ? MouseEvent::FromTouch | 940 event.fromTouch() ? MouseEvent::FromTouch |
941 : MouseEvent::RealOrIndistinguishable); | 941 : MouseEvent::RealOrIndistinguishable); |
942 | 942 |
943 return EventHandlingUtil::toWebInputEventResult( | 943 return EventHandlingUtil::toWebInputEventResult( |
944 dragTarget->dispatchEvent(me)); | 944 dragTarget->dispatchEvent(me)); |
945 } | 945 } |
946 | 946 |
947 void MouseEventManager::clearDragDataTransfer() { | 947 void MouseEventManager::clearDragDataTransfer() { |
| 948 if (!m_frame->page()) |
| 949 return; |
948 if (dragState().m_dragDataTransfer) { | 950 if (dragState().m_dragDataTransfer) { |
949 dragState().m_dragDataTransfer->clearDragImage(); | 951 dragState().m_dragDataTransfer->clearDragImage(); |
950 dragState().m_dragDataTransfer->setAccessPolicy(DataTransferNumb); | 952 dragState().m_dragDataTransfer->setAccessPolicy(DataTransferNumb); |
951 } | 953 } |
952 } | 954 } |
953 | 955 |
954 void MouseEventManager::dragSourceEndedAt(const WebMouseEvent& event, | 956 void MouseEventManager::dragSourceEndedAt(const WebMouseEvent& event, |
955 DragOperation operation) { | 957 DragOperation operation) { |
956 if (dragState().m_dragSrc) { | 958 if (dragState().m_dragSrc) { |
957 dragState().m_dragDataTransfer->setDestinationOperation(operation); | 959 dragState().m_dragDataTransfer->setDestinationOperation(operation); |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1046 | 1048 |
1047 void MouseEventManager::setClickCount(int clickCount) { | 1049 void MouseEventManager::setClickCount(int clickCount) { |
1048 m_clickCount = clickCount; | 1050 m_clickCount = clickCount; |
1049 } | 1051 } |
1050 | 1052 |
1051 bool MouseEventManager::mouseDownMayStartDrag() { | 1053 bool MouseEventManager::mouseDownMayStartDrag() { |
1052 return m_mouseDownMayStartDrag; | 1054 return m_mouseDownMayStartDrag; |
1053 } | 1055 } |
1054 | 1056 |
1055 } // namespace blink | 1057 } // namespace blink |
OLD | NEW |