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

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

Issue 2376583002: DevTools: remove WI.NetworkMapping.networkURL (Closed)
Patch Set: do not blackbox fs uiSourceCodes Created 4 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 unified diff | Download patch
OLDNEW
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 773 matching lines...) Expand 10 before | Expand all | Expand 10 after
784 }, 784 },
785 785
786 /** 786 /**
787 * @param {!WebInspector.ContextMenu} contextMenu 787 * @param {!WebInspector.ContextMenu} contextMenu
788 * @param {!WebInspector.UISourceCode} uiSourceCode 788 * @param {!WebInspector.UISourceCode} uiSourceCode
789 */ 789 */
790 _appendUISourceCodeMappingItems: function(contextMenu, uiSourceCode) 790 _appendUISourceCodeMappingItems: function(contextMenu, uiSourceCode)
791 { 791 {
792 WebInspector.NavigatorView.appendAddFolderItem(contextMenu); 792 WebInspector.NavigatorView.appendAddFolderItem(contextMenu);
793 if (uiSourceCode.project().type() === WebInspector.projectTypes.FileSyst em) { 793 if (uiSourceCode.project().type() === WebInspector.projectTypes.FileSyst em) {
794 var hasMappings = !!this._networkMapping.networkURL(uiSourceCode); 794 var binding = WebInspector.persistence.binding(uiSourceCode);
795 if (!hasMappings) 795 if (!binding)
796 contextMenu.appendItem(WebInspector.UIString.capitalize("Map to ^network ^resource\u2026"), this.mapFileSystemToNetwork.bind(this, uiSourceCode) ); 796 contextMenu.appendItem(WebInspector.UIString.capitalize("Map to ^network ^resource\u2026"), this.mapFileSystemToNetwork.bind(this, uiSourceCode) );
797 else 797 else
798 contextMenu.appendItem(WebInspector.UIString.capitalize("Remove ^network ^mapping"), this._removeNetworkMapping.bind(this, uiSourceCode)); 798 contextMenu.appendItem(WebInspector.UIString.capitalize("Remove ^network ^mapping"), this._removeNetworkMapping.bind(this, binding.network));
799 } 799 }
800 800
801 /** 801 /**
802 * @param {!WebInspector.Project} project 802 * @param {!WebInspector.Project} project
803 */ 803 */
804 function filterProject(project) 804 function filterProject(project)
805 { 805 {
806 return project.type() === WebInspector.projectTypes.FileSystem; 806 return project.type() === WebInspector.projectTypes.FileSystem;
807 } 807 }
808 808
809 if (uiSourceCode.project().type() === WebInspector.projectTypes.Network || uiSourceCode.project().type() === WebInspector.projectTypes.ContentScripts) { 809 if (uiSourceCode.project().type() === WebInspector.projectTypes.Network || uiSourceCode.project().type() === WebInspector.projectTypes.ContentScripts) {
810 if (!this._workspace.projects().filter(filterProject).length) 810 if (!this._workspace.projects().filter(filterProject).length)
811 return; 811 return;
812 var networkURL = this._networkMapping.networkURL(uiSourceCode); 812 if (this._networkMapping.uiSourceCodeForURLForAnyTarget(uiSourceCode .url()) === uiSourceCode)
813 if (this._networkMapping.uiSourceCodeForURLForAnyTarget(networkURL) === uiSourceCode)
814 contextMenu.appendItem(WebInspector.UIString.capitalize("Map to ^file ^system ^resource\u2026"), this.mapNetworkToFileSystem.bind(this, uiSource Code)); 813 contextMenu.appendItem(WebInspector.UIString.capitalize("Map to ^file ^system ^resource\u2026"), this.mapNetworkToFileSystem.bind(this, uiSource Code));
815 } 814 }
816 }, 815 },
817 816
818 /** 817 /**
819 * @param {!Event} event 818 * @param {!Event} event
820 * @param {!WebInspector.ContextMenu} contextMenu 819 * @param {!WebInspector.ContextMenu} contextMenu
821 * @param {!Object} target 820 * @param {!Object} target
822 */ 821 */
823 _appendUISourceCodeItems: function(event, contextMenu, target) 822 _appendUISourceCodeItems: function(event, contextMenu, target)
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after
1361 __proto__: WebInspector.VBox.prototype 1360 __proto__: WebInspector.VBox.prototype
1362 } 1361 }
1363 1362
1364 /** 1363 /**
1365 * @return {boolean} 1364 * @return {boolean}
1366 */ 1365 */
1367 WebInspector.SourcesPanel.WrapperView.isShowing = function() 1366 WebInspector.SourcesPanel.WrapperView.isShowing = function()
1368 { 1367 {
1369 return !!WebInspector.SourcesPanel.WrapperView._instance && WebInspector.Sou rcesPanel.WrapperView._instance.isShowing(); 1368 return !!WebInspector.SourcesPanel.WrapperView._instance && WebInspector.Sou rcesPanel.WrapperView._instance.isShowing();
1370 } 1369 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698