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..76889ba6cb8c8fa35d90ef0a1e019f666905b0cd 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 as ^global ^variable"), resolveNodeAndCall.bind(null, domNode, this._saveToTempVariable.bind(this))); |
|
paulirish
2015/10/26 19:16:28
Since we can, I would like to be more descriptive.
|
| + }, |
| + |
| + /** |
| + * @param {!WebInspector.ContextMenu} contextMenu |
| + * @param {!Object} target |
| + */ |
| _appendNetworkRequestItems: function(contextMenu, target) |
| { |
| if (!(target instanceof WebInspector.NetworkRequest)) |