Skip to content
  • enrica@apple.com's avatar
    Source/WebCore: WebKit2: add support for drag and drop on Windows · 466e2e16
    enrica@apple.com authored
    https://bugs.webkit.org/show_bug.cgi?id=52775
    <rdar://problem/8514409>
            
    Reviewed by Darin Adler and Adam Roben.
    
    On Windows the access to the content being dragged is
    provided via the IDataObject interface that is made available
    to the window that registers itself as drop target.
    Since this interface cannot be accessed from the WebProcess,
    in every call to one of the methods of the IDropTarget interface
    we serialize the content of the drag clipboard and send it over to
    the WebProcess.
    The bulk of this patch consists in the refactoring needed in DragData
    and ClipboardWin classes to extract the data from the serialized object.
            
    * platform/DragData.cpp:
    * platform/DragData.h:
    * platform/win/ClipboardUtilitiesWin.cpp:
    (WebCore::getWebLocData):
    (WebCore::getURL):
    (WebCore::getPlainText):
    (WebCore::getTextHTML):
    (WebCore::getCFHTML):
    (WebCore::fragmentFromFilenames):
    (WebCore::containsFilenames):
    (WebCore::fragmentFromHTML):
    (WebCore::containsHTML):
    (WebCore::getClipboardData):
    * platform/win/ClipboardUtilitiesWin.h:
    * platform/win/ClipboardWin.cpp:
    (WebCore::Clipboard::create):
    (WebCore::ClipboardWin::ClipboardWin):
    (WebCore::ClipboardWin::getData):
    (WebCore::ClipboardWin::types):
    (WebCore::ClipboardWin::files):
    (WebCore::ClipboardWin::hasData):
    * platform/win/ClipboardWin.h:
    (WebCore::ClipboardWin::create):
    * platform/win/DragDataWin.cpp:
    (WebCore::DragData::DragData):
    (WebCore::DragData::containsURL):
    (WebCore::DragData::dragDataMap):
    (WebCore::DragData::asURL):
    (WebCore::DragData::containsFiles):
    (WebCore::DragData::asFilenames):
    (WebCore::DragData::containsPlainText):
    (WebCore::DragData::asPlainText):
    (WebCore::DragData::canSmartReplace):
    (WebCore::DragData::containsCompatibleContent):
    (WebCore::DragData::asFragment):
    
    Source/WebKit2: WebKit2: add support for drag and drop on Windows
    https://bugs.webkit.org/show_bug.cgi?id=52775
    <rdar://problem/8514409>
    
    Reviewed by Darin Adler and Adam Roben.
    
    On Windows the access to the content being dragged is
    provided via the IDataObject interface that is made available
    to the window that registers itself as drop target.
    Since this interface cannot be accessed from the WebProcess,
    in every call to one of the methods of the IDropTarget interface
    we serialize the content of the drag clipboard and send it over to
    the WebProcess. The implementation uses the same messages as the
    Mac one, with slightly different parameters to pass the serialized
    clipboard.
    
    * UIProcess/WebPageProxy.cpp:
    (WebKit::WebPageProxy::performDragControllerAction): Added Windows
    specific implementation.
    * UIProcess/WebPageProxy.h:
    * UIProcess/win/WebView.cpp:
    (WebKit::WebView::WebView): Added dropTargetHelper object creation.
    (WebKit::WebView::initialize): Added to register for drag/drop with out
    refcount issues.
    (WebKit::WebView::close):
    (WebKit::WebView::windowReceivedMessage):
    (WebKit::WebView::QueryInterface):
    (WebKit::WebView::AddRef):
    (WebKit::WebView::Release):
    (WebKit::dragOperationToDragCursor):
    (WebKit::WebView::keyStateToDragOperation):
    (WebKit::WebView::DragEnter):
    (WebKit::WebView::DragOver):
    (WebKit::WebView::DragLeave):
    (WebKit::WebView::Drop):
    * UIProcess/win/WebView.h:
    (WebKit::WebView::create):
    * WebProcess/WebPage/WebPage.cpp:
    (WebKit::WebPage::performDragControllerAction):
    * WebProcess/WebPage/WebPage.h:
    * WebProcess/WebPage/WebPage.messages.in:
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76824 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    466e2e16