1 /* 2 * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. 3 */ 4 5 #include "config.h" 6 7 #include "NotImplemented.h" 8 #include "DataTransfer.h" 9 #include "Pasteboard.h" 10 #include "DragController.h" 11 #include "DragData.h" 12 13 namespace WebCore { 14 15 // FIXME: constants are from gtk port 16 const int DragController::MaxOriginalImageArea = 1500 * 1500; 17 const int DragController::DragIconRightInset = 7; 18 const int DragController::DragIconBottomInset = 3; 19 const float DragController::DragImageAlpha = 0.75f; 20 21 static bool copyKeyIsDown = false; 22 void setCopyKeyState(bool _copyKeyIsDown) 23 { 24 copyKeyIsDown = _copyKeyIsDown; 25 } 26 27 DragOperation DragController::dragOperation(const DragData& dragData) 28 { 29 //Protects the page from opening URL by fake anchor drag. 30 return dragData.containsURL() && !m_didInitiateDrag ? DragOperationCopy : DragOperationNone; 31 } 32 33 //uta: need to be fixed with usage of DragData pointer 34 bool DragController::isCopyKeyDown(const DragData&) 35 { 36 //State has not direct connection with keyboard state. 37 //Now it is imported from Java (user drag action). 38 return copyKeyIsDown; 39 } 40 41 void DragController::declareAndWriteDragImage(DataTransfer& clipboard, Element& element, const URL& url, const String& label) 42 { 43 clipboard.pasteboard().writeImage(element, url, label); 44 } 45 46 const IntSize &DragController::maxDragImageSize() 47 { 48 static const IntSize s(400, 400); 49 return s; 50 } 51 52 void DragController::cleanupAfterSystemDrag() 53 { 54 } 55 56 // PassRefPtr<DocumentFragment> DragController::createFragmentFromDragData(DragData& dragData, Frame& frame, Range&, bool /*allowPlainText*/, bool& /*chosePlainText*/) 57 // { 58 // } 59 60 } // namespace WebCore