Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1693)

Unified Diff: Source/web/WebViewImpl.cpp

Issue 255563004: Implement "Save image as" for canvas (blink side). (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/web/WebViewImpl.cpp
diff --git a/Source/web/WebViewImpl.cpp b/Source/web/WebViewImpl.cpp
index 5227dac584e044182ee14738420c11540f296a45..f0c886f5666a989d41ce74973bc06ebe7ee48903 100644
--- a/Source/web/WebViewImpl.cpp
+++ b/Source/web/WebViewImpl.cpp
@@ -3153,6 +3153,21 @@ void WebViewImpl::copyImageAt(const WebPoint& point)
m_page->mainFrame()->editor().copyImage(result);
}
+void WebViewImpl::saveImageAt(const WebPoint& point)
+{
+ if (!m_page)
+ return;
+
+ KURL url = hitTestResultForWindowPos(point).absoluteImageURL();
+
+ if (url.isEmpty())
+ return;
+
+ ResourceRequest request(url);
+ m_page->mainFrame()->loader().client()->loadURLExternally(
+ request, NavigationPolicyDownloadTo, WebString());
+}
+
void WebViewImpl::dragSourceEndedAt(
const WebPoint& clientPoint,
const WebPoint& screenPoint,

Powered by Google App Engine
This is Rietveld 408576698