| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |