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

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

Issue 1997453005: [Devtools] If already Data URI remove Copy Image URL in network (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 if (content.length > 0 && content[content.length - 1] === "=") 97 if (content.length > 0 && content[content.length - 1] === "=")
98 size--; 98 size--;
99 if (content.length > 1 && content[content.length - 2] === "=") 99 if (content.length > 1 && content[content.length - 2] === "=")
100 size--; 100 size--;
101 return size; 101 return size;
102 }, 102 },
103 103
104 _contextMenu: function(event) 104 _contextMenu: function(event)
105 { 105 {
106 var contextMenu = new WebInspector.ContextMenu(event); 106 var contextMenu = new WebInspector.ContextMenu(event);
107 contextMenu.appendItem(WebInspector.UIString.capitalize("Copy ^image URL "), this._copyImageURL.bind(this)); 107 if (!this._parsedURL.isDataURL())
108 contextMenu.appendItem(WebInspector.UIString.capitalize("Copy ^image URL"), this._copyImageURL.bind(this));
108 if (this._imagePreviewElement.src) 109 if (this._imagePreviewElement.src)
109 contextMenu.appendItem(WebInspector.UIString.capitalize("Copy ^image as Data URL"), this._copyImageAsDataURL.bind(this)); 110 contextMenu.appendItem(WebInspector.UIString.capitalize("Copy ^image as Data URI"), this._copyImageAsDataURL.bind(this));
110 contextMenu.appendItem(WebInspector.UIString.capitalize("Open ^image in ^new ^tab"), this._openInNewTab.bind(this)); 111 contextMenu.appendItem(WebInspector.UIString.capitalize("Open ^image in ^new ^tab"), this._openInNewTab.bind(this));
111 contextMenu.show(); 112 contextMenu.show();
112 }, 113 },
113 114
114 _copyImageAsDataURL: function() 115 _copyImageAsDataURL: function()
115 { 116 {
116 InspectorFrontendHost.copyText(this._imagePreviewElement.src); 117 InspectorFrontendHost.copyText(this._imagePreviewElement.src);
117 }, 118 },
118 119
119 _copyImageURL: function() 120 _copyImageURL: function()
120 { 121 {
121 InspectorFrontendHost.copyText(this._url); 122 InspectorFrontendHost.copyText(this._url);
122 }, 123 },
123 124
124 _openInNewTab: function() 125 _openInNewTab: function()
125 { 126 {
126 InspectorFrontendHost.openInNewTab(this._url); 127 InspectorFrontendHost.openInNewTab(this._url);
127 }, 128 },
128 129
129 __proto__: WebInspector.VBoxWithToolbarItems.prototype 130 __proto__: WebInspector.VBoxWithToolbarItems.prototype
130 } 131 }
OLDNEW
« 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