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

Unified Diff: third_party/WebKit/Source/devtools/front_end/sources/SourcesPanel.js

Issue 1409693007: DevTools fixes #459685. Right Clicking on an element should show "Store as Global Variable". (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Making context menu message a bit more descriptive. Created 5 years, 2 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 | « AUTHORS ('k') | third_party/WebKit/Source/devtools/front_end/sources/module.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/sources/SourcesPanel.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/SourcesPanel.js b/third_party/WebKit/Source/devtools/front_end/sources/SourcesPanel.js
index cb766c7dfbfc0ab14ea87b16bc274d9ab365722f..d3453b8b1cbc224beec7ddf4b082df7ec4c4d3f6 100644
--- a/third_party/WebKit/Source/devtools/front_end/sources/SourcesPanel.js
+++ b/third_party/WebKit/Source/devtools/front_end/sources/SourcesPanel.js
@@ -811,6 +811,7 @@ WebInspector.SourcesPanel.prototype = {
this._appendUISourceCodeItems(event, contextMenu, target);
this.appendUILocationItems(contextMenu, target);
this._appendRemoteObjectItems(contextMenu, target);
+ this._appendDOMNodeItems(contextMenu, target);
this._appendNetworkRequestItems(contextMenu, target);
},
@@ -970,6 +971,29 @@ WebInspector.SourcesPanel.prototype = {
* @param {!WebInspector.ContextMenu} contextMenu
* @param {!Object} target
*/
+ _appendDOMNodeItems: function (contextMenu, target) {
+ if (!(target instanceof WebInspector.DOMNode))
+ return;
+ var domNode = /** @type {!WebInspector.DOMNode} */ (target);
+
+ function resolveNodeAndCall(domNode, callback)
+ {
+ function resolvedNode(remoteObject)
+ {
+ if(remoteObject)
+ callback(remoteObject);
+ }
+
+ domNode.resolveToObject("", resolvedNode);
+ }
+
+ contextMenu.appendItem(WebInspector.UIString.capitalize("Store ^node as ^global ^variable"), resolveNodeAndCall.bind(null, domNode, this._saveToTempVariable.bind(this)));
pfeldman 2015/10/29 23:50:34 It'd be great if we could surface all the object-r
+ },
+
+ /**
+ * @param {!WebInspector.ContextMenu} contextMenu
+ * @param {!Object} target
+ */
_appendNetworkRequestItems: function(contextMenu, target)
{
if (!(target instanceof WebInspector.NetworkRequest))
« no previous file with comments | « AUTHORS ('k') | third_party/WebKit/Source/devtools/front_end/sources/module.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698