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

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

Issue 2412023002: DevTools: migrate InspectorView to tabbed view location. (Closed)
Patch Set: made layers panel closeable. 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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @constructor 6 * @constructor
7 * @implements {WebInspector.TabbedEditorContainerDelegate} 7 * @implements {WebInspector.TabbedEditorContainerDelegate}
8 * @implements {WebInspector.Searchable} 8 * @implements {WebInspector.Searchable}
9 * @implements {WebInspector.Replaceable} 9 * @implements {WebInspector.Replaceable}
10 * @extends {WebInspector.VBox} 10 * @extends {WebInspector.VBox}
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 69
70 var unsavedSourceCodes = []; 70 var unsavedSourceCodes = [];
71 var projects = WebInspector.workspace.projectsForType(WebInspector.proje ctTypes.FileSystem); 71 var projects = WebInspector.workspace.projectsForType(WebInspector.proje ctTypes.FileSystem);
72 for (var i = 0; i < projects.length; ++i) 72 for (var i = 0; i < projects.length; ++i)
73 unsavedSourceCodes = unsavedSourceCodes.concat(projects[i].uiSourceC odes().filter(isUnsaved)); 73 unsavedSourceCodes = unsavedSourceCodes.concat(projects[i].uiSourceC odes().filter(isUnsaved));
74 74
75 if (!unsavedSourceCodes.length) 75 if (!unsavedSourceCodes.length)
76 return; 76 return;
77 77
78 event.returnValue = WebInspector.UIString("DevTools have unsaved changes that will be permanently lost."); 78 event.returnValue = WebInspector.UIString("DevTools have unsaved changes that will be permanently lost.");
79 WebInspector.inspectorView.setCurrentPanel(WebInspector.SourcesPanel.ins tance()); 79 WebInspector.viewManager.showView("sources");
80 for (var i = 0; i < unsavedSourceCodes.length; ++i) 80 for (var i = 0; i < unsavedSourceCodes.length; ++i)
81 WebInspector.Revealer.reveal(unsavedSourceCodes[i]); 81 WebInspector.Revealer.reveal(unsavedSourceCodes[i]);
82 82
83 /** 83 /**
84 * @param {!WebInspector.UISourceCode} sourceCode 84 * @param {!WebInspector.UISourceCode} sourceCode
85 * @return {boolean} 85 * @return {boolean}
86 */ 86 */
87 function isUnsaved(sourceCode) 87 function isUnsaved(sourceCode)
88 { 88 {
89 var binding = WebInspector.persistence.binding(sourceCode); 89 var binding = WebInspector.persistence.binding(sourceCode);
(...skipping 723 matching lines...) Expand 10 before | Expand all | Expand 10 after
813 */ 813 */
814 handleAction: function(context, actionId) 814 handleAction: function(context, actionId)
815 { 815 {
816 var sourcesView = WebInspector.context.flavor(WebInspector.SourcesView); 816 var sourcesView = WebInspector.context.flavor(WebInspector.SourcesView);
817 if (!sourcesView) 817 if (!sourcesView)
818 return false; 818 return false;
819 sourcesView._editorContainer.closeAllFiles(); 819 sourcesView._editorContainer.closeAllFiles();
820 return true; 820 return true;
821 } 821 }
822 } 822 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698