Modified: branches/safari-534.54-branch/Source/WebKit2/ChangeLog (105762 => 105763)
--- branches/safari-534.54-branch/Source/WebKit2/ChangeLog 2012-01-24 19:26:14 UTC (rev 105762)
+++ branches/safari-534.54-branch/Source/WebKit2/ChangeLog 2012-01-24 19:28:13 UTC (rev 105763)
@@ -1,3 +1,24 @@
+2011-01-24 Lucas Forschler <[email protected]>
+
+ Merge 105558
+
+ 2012-01-20 Steve Falkenburg <[email protected]>
+
+ Reviewed by Alexey Proskuryakov.
+
+ Drag/drop of a file into a WebView on Windows needs to allow access to that file
+ https://bugs.webkit.org/show_bug.cgi?id=76753
+ <rdar://problem/10731719>
+
+ The Windows drag/drop code path was missing the code to open a file read exception.
+
+ Added code to match the Mac version, while allowing directories and multiple files to
+ also be dragged (matching our previous behavior).
+
+ * UIProcess/win/WebView.cpp:
+ (WebKit::maybeCreateSandboxExtensionFromDragData): Added.
+ (WebKit::WebView::Drop): Add a universal read exception if we're dragging a file into a WebView to open it.
+
2012-01-18 Anders Carlsson <[email protected]>
<rdar://problem/10516690> REGRESSION: Incomplete repaint on Flash element after pinch to zoom
Modified: branches/safari-534.54-branch/Source/WebKit2/UIProcess/win/WebView.cpp (105762 => 105763)
--- branches/safari-534.54-branch/Source/WebKit2/UIProcess/win/WebView.cpp 2012-01-24 19:26:14 UTC (rev 105762)
+++ branches/safari-534.54-branch/Source/WebKit2/UIProcess/win/WebView.cpp 2012-01-24 19:28:13 UTC (rev 105763)
@@ -46,6 +46,7 @@
#include <Commctrl.h>
#include <WebCore/BitmapInfo.h>
#include <WebCore/Cursor.h>
+#include <WebCore/FileSystem.h>
#include <WebCore/FloatRect.h>
#if USE(CG)
#include <WebCore/GraphicsContextCG.h>
@@ -1722,6 +1723,18 @@
return S_OK;
}
+static bool maybeCreateSandboxExtensionFromDragData(const DragData& dragData, SandboxExtension::Handle& sandboxExtensionHandle)
+{
+ if (!dragData.containsFiles())
+ return false;
+
+ // Unlike on Mac, we allow multiple files and directories, since on Windows
+ // we have actions for those (open the first file, open a Windows Explorer window).
+
+ SandboxExtension::createHandle("\\", SandboxExtension::ReadOnly, sandboxExtensionHandle);
+ return true;
+}
+
HRESULT STDMETHODCALLTYPE WebView::Drop(IDataObject* pDataObject, DWORD grfKeyState, POINTL pt, DWORD* pdwEffect)
{
if (m_dropTargetHelper)
@@ -1734,6 +1747,9 @@
DragData data(pDataObject, IntPoint(localpt.x, localpt.y), IntPoint(pt.x, pt.y), keyStateToDragOperation(grfKeyState));
SandboxExtension::Handle sandboxExtensionHandle;
+ bool createdExtension = maybeCreateSandboxExtensionFromDragData(data, sandboxExtensionHandle);
+ if (createdExtension)
+ m_page->process()->willAcquireUniversalFileReadSandboxExtension();
m_page->performDrag(&data, String(), sandboxExtensionHandle);
return S_OK;
}