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

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, 7 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
« no previous file with comments | « Source/web/WebViewImpl.h ('k') | public/web/WebContextMenuData.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebViewImpl.cpp
diff --git a/Source/web/WebViewImpl.cpp b/Source/web/WebViewImpl.cpp
index a070e5041f681efab4e87a51916b0604875b92c4..6d87b6d7cad1e667a8a364390b97caff19e097f5 100644
--- a/Source/web/WebViewImpl.cpp
+++ b/Source/web/WebViewImpl.cpp
@@ -3184,6 +3184,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,
« no previous file with comments | « Source/web/WebViewImpl.h ('k') | public/web/WebContextMenuData.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698