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

Unified Diff: third_party/WebKit/Source/devtools/front_end/source_frame/ImageView.js

Issue 2085753003: DevTools: add Save... to images in Application panel. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/source_frame/ImageView.js
diff --git a/third_party/WebKit/Source/devtools/front_end/source_frame/ImageView.js b/third_party/WebKit/Source/devtools/front_end/source_frame/ImageView.js
index 9ea1f11fc1a14d757baead71df557f6de70ab38e..d7d4cf9db7c6ac0b63be1d98d5c4b02c89baaa36 100644
--- a/third_party/WebKit/Source/devtools/front_end/source_frame/ImageView.js
+++ b/third_party/WebKit/Source/devtools/front_end/source_frame/ImageView.js
@@ -109,6 +109,7 @@ WebInspector.ImageView.prototype = {
if (this._imagePreviewElement.src)
contextMenu.appendItem(WebInspector.UIString.capitalize("Copy ^image as Data URI"), this._copyImageAsDataURL.bind(this));
contextMenu.appendItem(WebInspector.UIString.capitalize("Open ^image in ^new ^tab"), this._openInNewTab.bind(this));
+ contextMenu.appendItem(WebInspector.UIString.capitalize("Save\u2026"), this._saveImage.bind(this));
contextMenu.show();
},
@@ -122,6 +123,14 @@ WebInspector.ImageView.prototype = {
InspectorFrontendHost.copyText(this._url);
},
+ _saveImage: function()
+ {
+ var link = createElement("a");
+ link.download = this._parsedURL.displayName;
+ link.href = this._url;
+ link.click();
+ },
+
_openInNewTab: function()
{
InspectorFrontendHost.openInNewTab(this._url);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698