Skip to content
  • timothy_horton@apple.com's avatar
    PDFPlugin: Cannot drop files/URLs on PDFPlugin · 8e3ce2f3
    timothy_horton@apple.com authored
    https://bugs.webkit.org/show_bug.cgi?id=105516
    <rdar://problem/12729443>
    
    Reviewed by Alexey Proskuryakov.
    
    Add shouldAllowNavigationFromDrags to Plugin/PluginView/etc., which WebCore will
    consult when dragging over a PluginDocument to decide whether or not a drag may result in navigation.
    
    * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
    (WebKit::NetscapePlugin::shouldAllowNavigationFromDrags): Added, always returning false to keep existing behavior.
    * WebProcess/Plugins/Netscape/NetscapePlugin.h:
    (NetscapePlugin): Added.
    * WebProcess/Plugins/PDF/SimplePDFPlugin.h:
    (WebKit::SimplePDFPlugin::shouldAllowNavigationFromDrags): Added, always returning true. (Simple)PDFPlugin should
    navigate when dropped onto, just like an image or HTML document would.
    * WebProcess/Plugins/Plugin.h:
    (Plugin): Add shouldAllowNavigationFromDrags.
    * WebProcess/Plugins/PluginProxy.h: Add shouldAllowNavigationFromDrags.
    * WebProcess/Plugins/PluginView.cpp:
    (WebKit::PluginView::shouldAllowNavigationFromDrags): Forward shouldAllowNavigationFromDrags to the plugin.
    * WebProcess/Plugins/PluginView.h: Add shouldAllowNavigationFromDrags.
    
    * page/DragController.cpp:
    (WebCore::DragController::operationForLoad): If we drag over a PluginDocument, check if its PluginView
    claims to support navigation resulting from a drag (only PDFPlugin will for now). If it does, allow the drag.
    * plugins/PluginViewBase.h:
    (WebCore::PluginViewBase::shouldAllowNavigationFromDrags): Add shouldAllowNavigationFromDrags.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138361 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    8e3ce2f3