Index: Source/web/WebViewImpl.cpp |
diff --git a/Source/web/WebViewImpl.cpp b/Source/web/WebViewImpl.cpp |
index 572e42bd4c3d09d6e3479a593b63e3b8d3a00b5e..e7ffa0fc2bd3df2950bc6a1519b5ffe63e9b0350 100644 |
--- a/Source/web/WebViewImpl.cpp |
+++ b/Source/web/WebViewImpl.cpp |
@@ -3296,18 +3296,18 @@ void WebViewImpl::copyImageAt(const WebPoint& point) |
void WebViewImpl::saveImageAt(const WebPoint& point) |
{ |
- if (!m_page) |
+ if (!m_client) |
return; |
- KURL url = hitTestResultForWindowPos(point).absoluteImageURLIncludingCanvasDataURL(); |
+ Node* node = hitTestResultForWindowPos(point).innerNonSharedNode(); |
+ if (!node || !(isHTMLCanvasElement(*node) || isHTMLImageElement(*node))) |
+ return; |
- if (url.isEmpty()) |
+ String url = toElement(*node).imageSourceURL(); |
+ if (!KURL(KURL(), url).protocolIsData()) |
return; |
Justin Novosad
2014/09/05 17:22:46
If the user attempts to save an image with an http
zino
2014/09/05 18:00:26
On 2014/09/05 17:22:46, junov wrote:
If the user
Ken Russell (switch to Gerrit)
2014/09/11 00:43:06
Thanks for clarifying this.
|
- ResourceRequest request(url); |
- request.setRequestContext(WebURLRequest::RequestContextDownload); |
- m_page->deprecatedLocalMainFrame()->loader().client()->loadURLExternally( |
- request, NavigationPolicyDownloadTo, WebString()); |
+ m_client->saveImageFromDataURL(url); |
} |
void WebViewImpl::dragSourceEndedAt( |