Chromium Code Reviews| 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)) |