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

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

Issue 2529303003: DevTools: move FileSystemMapping from Workspace to Persistence (Closed)
Patch Set: fix tests Created 4 years 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 733 matching lines...) Expand 10 before | Expand all | Expand 10 after
744 uiSourceCode.name(), [Workspace.projectTypes.Network, Workspace.projectT ypes.ContentScripts], 744 uiSourceCode.name(), [Workspace.projectTypes.Network, Workspace.projectT ypes.ContentScripts],
745 mapFileSystemToNetwork); 745 mapFileSystemToNetwork);
746 746
747 /** 747 /**
748 * @param {?Workspace.UISourceCode} networkUISourceCode 748 * @param {?Workspace.UISourceCode} networkUISourceCode
749 */ 749 */
750 function mapFileSystemToNetwork(networkUISourceCode) { 750 function mapFileSystemToNetwork(networkUISourceCode) {
751 if (!networkUISourceCode) 751 if (!networkUISourceCode)
752 return; 752 return;
753 var fileSystemPath = Persistence.FileSystemWorkspaceBinding.fileSystemPath (uiSourceCode.project().id()); 753 var fileSystemPath = Persistence.FileSystemWorkspaceBinding.fileSystemPath (uiSourceCode.project().id());
754 Workspace.fileSystemMapping.addMappingForResource(networkUISourceCode.url( ), fileSystemPath, uiSourceCode.url()); 754 Persistence.fileSystemMapping.addMappingForResource(
755 networkUISourceCode.url(), fileSystemPath, uiSourceCode.url());
755 } 756 }
756 } 757 }
757 758
758 /** 759 /**
759 * @param {!Workspace.UISourceCode} networkUISourceCode 760 * @param {!Workspace.UISourceCode} networkUISourceCode
760 */ 761 */
761 mapNetworkToFileSystem(networkUISourceCode) { 762 mapNetworkToFileSystem(networkUISourceCode) {
762 Sources.SelectUISourceCodeForProjectTypesDialog.show( 763 Sources.SelectUISourceCodeForProjectTypesDialog.show(
763 networkUISourceCode.name(), [Workspace.projectTypes.FileSystem], mapNetw orkToFileSystem); 764 networkUISourceCode.name(), [Workspace.projectTypes.FileSystem], mapNetw orkToFileSystem);
764 765
765 /** 766 /**
766 * @param {?Workspace.UISourceCode} uiSourceCode 767 * @param {?Workspace.UISourceCode} uiSourceCode
767 */ 768 */
768 function mapNetworkToFileSystem(uiSourceCode) { 769 function mapNetworkToFileSystem(uiSourceCode) {
769 if (!uiSourceCode) 770 if (!uiSourceCode)
770 return; 771 return;
771 var fileSystemPath = Persistence.FileSystemWorkspaceBinding.fileSystemPath (uiSourceCode.project().id()); 772 var fileSystemPath = Persistence.FileSystemWorkspaceBinding.fileSystemPath (uiSourceCode.project().id());
772 Workspace.fileSystemMapping.addMappingForResource(networkUISourceCode.url( ), fileSystemPath, uiSourceCode.url()); 773 Persistence.fileSystemMapping.addMappingForResource(
774 networkUISourceCode.url(), fileSystemPath, uiSourceCode.url());
773 } 775 }
774 } 776 }
775 777
776 /** 778 /**
777 * @param {!Workspace.UISourceCode} uiSourceCode 779 * @param {!Workspace.UISourceCode} uiSourceCode
778 */ 780 */
779 _removeNetworkMapping(uiSourceCode) { 781 _removeNetworkMapping(uiSourceCode) {
780 Workspace.fileSystemMapping.removeMappingForURL(uiSourceCode.url()); 782 Persistence.fileSystemMapping.removeMappingForURL(uiSourceCode.url());
781 } 783 }
782 784
783 /** 785 /**
784 * @param {!UI.ContextMenu} contextMenu 786 * @param {!UI.ContextMenu} contextMenu
785 * @param {!Workspace.UISourceCode} uiSourceCode 787 * @param {!Workspace.UISourceCode} uiSourceCode
786 */ 788 */
787 _appendUISourceCodeMappingItems(contextMenu, uiSourceCode) { 789 _appendUISourceCodeMappingItems(contextMenu, uiSourceCode) {
788 Sources.NavigatorView.appendAddFolderItem(contextMenu); 790 Sources.NavigatorView.appendAddFolderItem(contextMenu);
789 791
790 if (Runtime.experiments.isEnabled('persistence2')) 792 if (Runtime.experiments.isEnabled('persistence2'))
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after
1322 */ 1324 */
1323 willHide() { 1325 willHide() {
1324 UI.inspectorView.setDrawerMinimized(false); 1326 UI.inspectorView.setDrawerMinimized(false);
1325 setImmediate(() => Sources.SourcesPanel.updateResizerAndSidebarButtons(Sourc es.SourcesPanel.instance())); 1327 setImmediate(() => Sources.SourcesPanel.updateResizerAndSidebarButtons(Sourc es.SourcesPanel.instance()));
1326 } 1328 }
1327 1329
1328 _showViewInWrapper() { 1330 _showViewInWrapper() {
1329 this._view.show(this.element); 1331 this._view.show(this.element);
1330 } 1332 }
1331 }; 1333 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698