diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog index aae15c94b4ce..005de8ff9882 100644 --- a/WebCore/ChangeLog +++ b/WebCore/ChangeLog @@ -1,20 +1,3 @@ -2009-05-29 Adam Roben - - Make sure PlatformMouseEvent::modifierFlags contains MK_ALT when the - Alt key is pressed - - First part of fixing Bug 25729: Alt-clicking a link doesn't start a - download - - - Reviewed by Darin Adler. - - No test possible. - - * platform/win/PlatformMouseEventWin.cpp: - (WebCore::PlatformMouseEvent::PlatformMouseEvent): Add MK_ALT to the - modifier flags when the Alt key is pressed. - 2009-05-29 Alexander Macdonald Reviewed by Darin Adler. diff --git a/WebCore/platform/win/PlatformMouseEventWin.cpp b/WebCore/platform/win/PlatformMouseEventWin.cpp index 8bda58678aca..7110b3948043 100644 --- a/WebCore/platform/win/PlatformMouseEventWin.cpp +++ b/WebCore/platform/win/PlatformMouseEventWin.cpp @@ -85,11 +85,6 @@ PlatformMouseEvent::PlatformMouseEvent(HWND hWnd, UINT message, WPARAM wParam, L , m_eventType(messageToEventType(message)) , m_modifierFlags(wParam) { - // The modifier flags Windows gives us never contain MK_ALT, but we need it to be present (see - // ). - if (m_altKey) - m_modifierFlags |= MK_ALT; - m_timestamp = ::GetTickCount()*0.001; // GetTickCount returns milliseconds switch (message) { diff --git a/WebKit/win/ChangeLog b/WebKit/win/ChangeLog index 7692c5657d1f..26bf1285eb18 100644 --- a/WebKit/win/ChangeLog +++ b/WebKit/win/ChangeLog @@ -1,32 +1,3 @@ -2009-05-29 Adam Roben - - Implement WebFrame::startDownload - - Fixes Bug 25729: Alt-clicking a link doesn't start a download - - - Reviewed by Darin Adler. - - * WebFrame.cpp: - (WebFrame::startDownload): Call through to WebView::downloadURL. - -2009-05-29 Adam Roben - - Move WebContextMenuClient's downloading code to WebView - - This will allow other code to trigger downloads using this code, and - matches Mac. - - Reviewed by Darin Adler. - - * WebCoreSupport/WebContextMenuClient.cpp: - (WebContextMenuClient::downloadURL): Moved code from here... - * WebView.cpp: - (WebView::downloadURL): ...to here. Also tightened up the code a - little bit and removed an unnecessary LOG_ERROR. - - * WebView.h: Added downloadURL. - 2009-05-29 Brent Fulgham Reviewed by Darin Adler. diff --git a/WebKit/win/WebCoreSupport/WebContextMenuClient.cpp b/WebKit/win/WebCoreSupport/WebContextMenuClient.cpp index 687ced78d893..b0d69126e26e 100644 --- a/WebKit/win/WebCoreSupport/WebContextMenuClient.cpp +++ b/WebKit/win/WebCoreSupport/WebContextMenuClient.cpp @@ -26,6 +26,7 @@ #include "config.h" #include "WebContextMenuClient.h" +#include "WebDownload.h" #include "WebElementPropertyBag.h" #include "WebLocalizableStrings.h" #include "WebView.h" @@ -132,7 +133,19 @@ void WebContextMenuClient::contextMenuItemSelected(ContextMenuItem* item, const void WebContextMenuClient::downloadURL(const KURL& url) { - m_webView->downloadURL(url); + COMPtr downloadDelegate; + if (FAILED(m_webView->downloadDelegate(&downloadDelegate))) { + // If the WebView doesn't successfully provide a download delegate we'll pass a null one + // into the WebDownload - which may or may not decide to use a DefaultDownloadDelegate + LOG_ERROR("Failed to get downloadDelegate from WebView"); + downloadDelegate = 0; + } + + // Its the delegate's job to ref the WebDownload to keep it alive - otherwise it will be destroyed + // when this method returns + COMPtr download; + download.adoptRef(WebDownload::createInstance(url, downloadDelegate.get())); + download->start(); } void WebContextMenuClient::searchWithGoogle(const Frame* frame) diff --git a/WebKit/win/WebFrame.cpp b/WebKit/win/WebFrame.cpp index c962dc7dbd07..d1d09d3ce3c2 100644 --- a/WebKit/win/WebFrame.cpp +++ b/WebKit/win/WebFrame.cpp @@ -1605,9 +1605,9 @@ void WebFrame::dispatchDidFailLoad(const ResourceError& error) } } -void WebFrame::startDownload(const ResourceRequest& request) +void WebFrame::startDownload(const ResourceRequest&) { - d->webView->downloadURL(request.url()); + notImplemented(); } Widget* WebFrame::createJavaAppletWidget(const IntSize& pluginSize, HTMLAppletElement* element, const KURL& /*baseURL*/, const Vector& paramNames, const Vector& paramValues) diff --git a/WebKit/win/WebView.cpp b/WebKit/win/WebView.cpp index 253b621e202e..de8a43dd9864 100644 --- a/WebKit/win/WebView.cpp +++ b/WebKit/win/WebView.cpp @@ -32,7 +32,6 @@ #include "MarshallingHelpers.h" #include "WebDatabaseManager.h" #include "WebDocumentLoader.h" -#include "WebDownload.h" #include "WebEditorClient.h" #include "WebElementPropertyBag.h" #include "WebFrame.h" @@ -5191,14 +5190,6 @@ HRESULT WebView::setJavaScriptURLsAreAllowed(BOOL areAllowed) return S_OK; } -void WebView::downloadURL(const KURL& url) -{ - // Its the delegate's job to ref the WebDownload to keep it alive - otherwise it will be destroyed - // when this function returns. - COMPtr download(AdoptCOM, WebDownload::createInstance(url, m_downloadDelegate.get())); - download->start(); -} - class EnumTextMatches : public IEnumTextMatches { long m_ref; diff --git a/WebKit/win/WebView.h b/WebKit/win/WebView.h index 1aa1e687c548..23905b709d47 100644 --- a/WebKit/win/WebView.h +++ b/WebKit/win/WebView.h @@ -817,8 +817,6 @@ class WebView bool onGetObject(WPARAM, LPARAM, LRESULT&) const; static STDMETHODIMP AccessibleObjectFromWindow(HWND, DWORD objectID, REFIID, void** ppObject); - void downloadURL(const WebCore::KURL&); - private: void setZoomMultiplier(float multiplier, bool isTextOnly); float zoomMultiplier(bool isTextOnly);