summaryrefslogtreecommitdiff
path: root/Source/WebKit2/UIProcess/win/WebView.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-02-03 09:55:33 +0100
committerSimon Hausmann <simon.hausmann@nokia.com>2012-02-03 09:55:33 +0100
commitcd44dc59cdfc39534aef4d417e9f3c412e3be139 (patch)
tree8d89889ba95ed6ec9322e733846cc9cce9d7dff1 /Source/WebKit2/UIProcess/win/WebView.cpp
parentd11f84f5b5cdc0d92a08af01b13472fdd5f9acb9 (diff)
downloadqtwebkit-cd44dc59cdfc39534aef4d417e9f3c412e3be139.tar.gz
Imported WebKit commit fce473cb4d55aa9fe9d0b0322a2fffecb731b961 (http://svn.webkit.org/repository/webkit/trunk@106560)
Diffstat (limited to 'Source/WebKit2/UIProcess/win/WebView.cpp')
-rw-r--r--Source/WebKit2/UIProcess/win/WebView.cpp33
1 files changed, 24 insertions, 9 deletions
diff --git a/Source/WebKit2/UIProcess/win/WebView.cpp b/Source/WebKit2/UIProcess/win/WebView.cpp
index d44e25560..c0e9f1729 100644
--- a/Source/WebKit2/UIProcess/win/WebView.cpp
+++ b/Source/WebKit2/UIProcess/win/WebView.cpp
@@ -32,11 +32,7 @@
#include "NativeWebKeyboardEvent.h"
#include "NativeWebMouseEvent.h"
#include "NativeWebWheelEvent.h"
-#include "RunLoop.h"
#include "WKAPICast.h"
-#if USE(CG)
-#include "WKCACFViewWindow.h"
-#endif
#include "WebContext.h"
#include "WebContextMenuProxyWin.h"
#include "WebEditCommandProxy.h"
@@ -48,19 +44,24 @@
#include <WebCore/Cursor.h>
#include <WebCore/DragSession.h>
#include <WebCore/Editor.h>
+#include <WebCore/FileSystem.h>
#include <WebCore/FloatRect.h>
-#if USE(CG)
-#include <WebCore/GraphicsContextCG.h>
-#endif
+#include <WebCore/HWndDC.h>
#include <WebCore/IntRect.h>
#include <WebCore/NotImplemented.h>
#include <WebCore/Region.h>
+#include <WebCore/RunLoop.h>
#include <WebCore/SoftLinking.h>
#include <WebCore/WebCoreInstanceHandle.h>
#include <WebCore/WindowMessageBroadcaster.h>
#include <WebCore/WindowsTouch.h>
#include <wtf/text/WTFString.h>
+#if USE(CG)
+#include "WKCACFViewWindow.h"
+#include <WebCore/GraphicsContextCG.h>
+#endif
+
#if ENABLE(FULLSCREEN_API)
#include "WebFullScreenManagerProxy.h"
#include <WebCore/FullScreenController.h>
@@ -959,9 +960,8 @@ void WebView::scrollView(const IntRect& scrollRect, const IntSize& scrollOffset)
void WebView::flashBackingStoreUpdates(const Vector<IntRect>& updateRects)
{
static HBRUSH brush = createBrush(WebPageProxy::backingStoreUpdatesFlashColor().rgb()).leakPtr();
- HDC dc = ::GetDC(m_window);
+ HWndDC dc(m_window);
flashRects(dc, updateRects.data(), updateRects.size(), brush);
- ::ReleaseDC(m_window, dc);
}
WebCore::IntSize WebView::viewSize()
@@ -1708,6 +1708,18 @@ HRESULT STDMETHODCALLTYPE WebView::DragLeave()
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)
@@ -1720,6 +1732,9 @@ HRESULT STDMETHODCALLTYPE WebView::Drop(IDataObject* pDataObject, DWORD grfKeySt
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;
}