Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. |
| 3 * Copyright (C) 2011 Google Inc. All rights reserved. | 3 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 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 793 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 804 * @override | 804 * @override |
| 805 * @param {!Event} event | 805 * @param {!Event} event |
| 806 * @param {!WebInspector.ContextMenu} contextMenu | 806 * @param {!WebInspector.ContextMenu} contextMenu |
| 807 * @param {!Object} target | 807 * @param {!Object} target |
| 808 */ | 808 */ |
| 809 appendApplicableItems: function(event, contextMenu, target) | 809 appendApplicableItems: function(event, contextMenu, target) |
| 810 { | 810 { |
| 811 this._appendUISourceCodeItems(event, contextMenu, target); | 811 this._appendUISourceCodeItems(event, contextMenu, target); |
| 812 this.appendUILocationItems(contextMenu, target); | 812 this.appendUILocationItems(contextMenu, target); |
| 813 this._appendRemoteObjectItems(contextMenu, target); | 813 this._appendRemoteObjectItems(contextMenu, target); |
| 814 this._appendDOMNodeItems(contextMenu, target); | |
| 814 this._appendNetworkRequestItems(contextMenu, target); | 815 this._appendNetworkRequestItems(contextMenu, target); |
| 815 }, | 816 }, |
| 816 | 817 |
| 817 /** | 818 /** |
| 818 * @param {!WebInspector.UISourceCode} uiSourceCode | 819 * @param {!WebInspector.UISourceCode} uiSourceCode |
| 819 */ | 820 */ |
| 820 mapFileSystemToNetwork: function(uiSourceCode) | 821 mapFileSystemToNetwork: function(uiSourceCode) |
| 821 { | 822 { |
| 822 WebInspector.SelectUISourceCodeForProjectTypesDialog.show(uiSourceCode.n ame(), [WebInspector.projectTypes.Network, WebInspector.projectTypes.ContentScri pts], mapFileSystemToNetwork.bind(this)); | 823 WebInspector.SelectUISourceCodeForProjectTypesDialog.show(uiSourceCode.n ame(), [WebInspector.projectTypes.Network, WebInspector.projectTypes.ContentScri pts], mapFileSystemToNetwork.bind(this)); |
| 823 | 824 |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 963 if (remoteObject.type === "function") | 964 if (remoteObject.type === "function") |
| 964 contextMenu.appendItem(WebInspector.UIString.capitalize("Show ^funct ion ^definition"), this._showFunctionDefinition.bind(this, remoteObject)); | 965 contextMenu.appendItem(WebInspector.UIString.capitalize("Show ^funct ion ^definition"), this._showFunctionDefinition.bind(this, remoteObject)); |
| 965 if (remoteObject.subtype === "generator") | 966 if (remoteObject.subtype === "generator") |
| 966 contextMenu.appendItem(WebInspector.UIString.capitalize("Show ^gener ator ^location"), this._showGeneratorLocation.bind(this, remoteObject)); | 967 contextMenu.appendItem(WebInspector.UIString.capitalize("Show ^gener ator ^location"), this._showGeneratorLocation.bind(this, remoteObject)); |
| 967 }, | 968 }, |
| 968 | 969 |
| 969 /** | 970 /** |
| 970 * @param {!WebInspector.ContextMenu} contextMenu | 971 * @param {!WebInspector.ContextMenu} contextMenu |
| 971 * @param {!Object} target | 972 * @param {!Object} target |
| 972 */ | 973 */ |
| 974 _appendDOMNodeItems: function (contextMenu, target) { | |
| 975 if (!(target instanceof WebInspector.DOMNode)) | |
| 976 return; | |
| 977 var domNode = /** @type {!WebInspector.DOMNode} */ (target); | |
| 978 | |
| 979 function resolveNodeAndCall(domNode, callback) | |
| 980 { | |
| 981 function resolvedNode(remoteObject) | |
| 982 { | |
| 983 if(remoteObject) | |
| 984 callback(remoteObject); | |
| 985 } | |
| 986 | |
| 987 domNode.resolveToObject("", resolvedNode); | |
| 988 } | |
| 989 | |
| 990 contextMenu.appendItem(WebInspector.UIString.capitalize("Store as ^globa l ^variable"), resolveNodeAndCall.bind(null, domNode, this._saveToTempVariable.b ind(this))); | |
|
paulirish
2015/10/26 19:16:28
Since we can, I would like to be more descriptive.
| |
| 991 }, | |
| 992 | |
| 993 /** | |
| 994 * @param {!WebInspector.ContextMenu} contextMenu | |
| 995 * @param {!Object} target | |
| 996 */ | |
| 973 _appendNetworkRequestItems: function(contextMenu, target) | 997 _appendNetworkRequestItems: function(contextMenu, target) |
| 974 { | 998 { |
| 975 if (!(target instanceof WebInspector.NetworkRequest)) | 999 if (!(target instanceof WebInspector.NetworkRequest)) |
| 976 return; | 1000 return; |
| 977 var request = /** @type {!WebInspector.NetworkRequest} */ (target); | 1001 var request = /** @type {!WebInspector.NetworkRequest} */ (target); |
| 978 var uiSourceCode = this._networkMapping.uiSourceCodeForURLForAnyTarget(r equest.url); | 1002 var uiSourceCode = this._networkMapping.uiSourceCodeForURLForAnyTarget(r equest.url); |
| 979 if (!uiSourceCode) | 1003 if (!uiSourceCode) |
| 980 return; | 1004 return; |
| 981 var openText = WebInspector.UIString.capitalize("Open in Sources ^panel" ); | 1005 var openText = WebInspector.UIString.capitalize("Open in Sources ^panel" ); |
| 982 contextMenu.appendItem(openText, this.showUILocation.bind(this, uiSource Code.uiLocation(0, 0))); | 1006 contextMenu.appendItem(openText, this.showUILocation.bind(this, uiSource Code.uiLocation(0, 0))); |
| (...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1427 WebInspector.SourcesPanelFactory.prototype = { | 1451 WebInspector.SourcesPanelFactory.prototype = { |
| 1428 /** | 1452 /** |
| 1429 * @override | 1453 * @override |
| 1430 * @return {!WebInspector.Panel} | 1454 * @return {!WebInspector.Panel} |
| 1431 */ | 1455 */ |
| 1432 createPanel: function() | 1456 createPanel: function() |
| 1433 { | 1457 { |
| 1434 return WebInspector.SourcesPanel.instance(); | 1458 return WebInspector.SourcesPanel.instance(); |
| 1435 } | 1459 } |
| 1436 } | 1460 } |
| OLD | NEW |