| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 | 57 |
| 58 this._statusBarContainerElement.appendChild(this._scriptViewStatusBarItemsCo
ntainer); | 58 this._statusBarContainerElement.appendChild(this._scriptViewStatusBarItemsCo
ntainer); |
| 59 this._statusBarContainerElement.appendChild(this._scriptViewStatusBarTextCon
tainer); | 59 this._statusBarContainerElement.appendChild(this._scriptViewStatusBarTextCon
tainer); |
| 60 | 60 |
| 61 WebInspector.startBatchUpdate(); | 61 WebInspector.startBatchUpdate(); |
| 62 this._workspace.uiSourceCodes().forEach(this._addUISourceCode.bind(this)); | 62 this._workspace.uiSourceCodes().forEach(this._addUISourceCode.bind(this)); |
| 63 WebInspector.endBatchUpdate(); | 63 WebInspector.endBatchUpdate(); |
| 64 | 64 |
| 65 this._workspace.addEventListener(WebInspector.Workspace.Events.UISourceCodeA
dded, this._uiSourceCodeAdded, this); | 65 this._workspace.addEventListener(WebInspector.Workspace.Events.UISourceCodeA
dded, this._uiSourceCodeAdded, this); |
| 66 this._workspace.addEventListener(WebInspector.Workspace.Events.UISourceCodeR
emoved, this._uiSourceCodeRemoved, this); | 66 this._workspace.addEventListener(WebInspector.Workspace.Events.UISourceCodeR
emoved, this._uiSourceCodeRemoved, this); |
| 67 this._workspace.addEventListener(WebInspector.Workspace.Events.ProjectWillRe
set, this._projectWillReset.bind(this), this); | 67 this._workspace.addEventListener(WebInspector.Workspace.Events.ProjectRemove
d, this._projectRemoved.bind(this), this); |
| 68 | 68 |
| 69 function handleBeforeUnload(event) | 69 function handleBeforeUnload(event) |
| 70 { | 70 { |
| 71 if (event.returnValue) | 71 if (event.returnValue) |
| 72 return; | 72 return; |
| 73 var unsavedSourceCodes = WebInspector.workspace.unsavedSourceCodes(); | 73 var unsavedSourceCodes = WebInspector.workspace.unsavedSourceCodes(); |
| 74 if (!unsavedSourceCodes.length) | 74 if (!unsavedSourceCodes.length) |
| 75 return; | 75 return; |
| 76 | 76 |
| 77 event.returnValue = WebInspector.UIString("DevTools have unsaved changes
that will be permanently lost."); | 77 event.returnValue = WebInspector.UIString("DevTools have unsaved changes
that will be permanently lost."); |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 */ | 253 */ |
| 254 _removeUISourceCodes: function(uiSourceCodes) | 254 _removeUISourceCodes: function(uiSourceCodes) |
| 255 { | 255 { |
| 256 this._editorContainer.removeUISourceCodes(uiSourceCodes); | 256 this._editorContainer.removeUISourceCodes(uiSourceCodes); |
| 257 for (var i = 0; i < uiSourceCodes.length; ++i) { | 257 for (var i = 0; i < uiSourceCodes.length; ++i) { |
| 258 this._removeSourceFrame(uiSourceCodes[i]); | 258 this._removeSourceFrame(uiSourceCodes[i]); |
| 259 this._historyManager.removeHistoryForSourceCode(uiSourceCodes[i]); | 259 this._historyManager.removeHistoryForSourceCode(uiSourceCodes[i]); |
| 260 } | 260 } |
| 261 }, | 261 }, |
| 262 | 262 |
| 263 _projectWillReset: function(event) | 263 _projectRemoved: function(event) |
| 264 { | 264 { |
| 265 var project = event.data; | 265 var project = event.data; |
| 266 var uiSourceCodes = project.uiSourceCodes(); | 266 var uiSourceCodes = project.uiSourceCodes(); |
| 267 this._removeUISourceCodes(uiSourceCodes); | 267 this._removeUISourceCodes(uiSourceCodes); |
| 268 if (project.type() === WebInspector.projectTypes.Network) | 268 if (project.type() === WebInspector.projectTypes.Network) |
| 269 this._editorContainer.reset(); | 269 this._editorContainer.reset(); |
| 270 }, | 270 }, |
| 271 | 271 |
| 272 _updateScriptViewStatusBarItems: function() | 272 _updateScriptViewStatusBarItems: function() |
| 273 { | 273 { |
| (...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 699 { | 699 { |
| 700 } | 700 } |
| 701 | 701 |
| 702 WebInspector.SourcesView.EditorAction.prototype = { | 702 WebInspector.SourcesView.EditorAction.prototype = { |
| 703 /** | 703 /** |
| 704 * @param {!WebInspector.SourcesView} sourcesView | 704 * @param {!WebInspector.SourcesView} sourcesView |
| 705 * @return {!Element} | 705 * @return {!Element} |
| 706 */ | 706 */ |
| 707 button: function(sourcesView) { } | 707 button: function(sourcesView) { } |
| 708 } | 708 } |
| OLD | NEW |