Changeset 117267 in webkit
- Timestamp:
- May 16, 2012 5:22:29 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r117266 r117267 1 2012-05-16 Pavel Feldman <pfeldman@chromium.org> 2 3 Web Inspector: get rid of UISourceCodeListChanged event. 4 https://bugs.webkit.org/show_bug.cgi?id=86601 5 6 Reviewed by Vsevolod Vlasov. 7 8 * http/tests/inspector/compiler-script-mapping.html: 9 * inspector/debugger/scripts-panel.html: 10 1 11 2012-05-16 Yury Semikhatsky <yurys@chromium.org> 2 12 -
trunk/LayoutTests/http/tests/inspector/compiler-script-mapping.html
r117235 r117267 194 194 WebInspector.debuggerModel._reset(); 195 195 var debuggerScriptMapping = new WebInspector.DebuggerScriptMapping(); 196 debuggerScriptMapping.addEventListener(WebInspector. DebuggerScriptMapping.Events.UISourceCodeAdded, uiSourceCodeAdded);196 debuggerScriptMapping.addEventListener(WebInspector.ScriptMapping.Events.UISourceCodeAdded, uiSourceCodeAdded); 197 197 198 198 var script = InspectorTest.createScriptMock("compiled.js", 0, 0, true, ""); -
trunk/LayoutTests/inspector/debugger/scripts-panel-expected.txt
r113563 r117267 29 29 Dumping ScriptsNavigator 'Scripts' tab: 30 30 foo.js 31 source1.js 32 source2.js 33 Dumping ScriptsNavigator 'Content scripts' tab: 34 Source requested for source2.js 35 Source requested for source1.js 36 Source requested for compiled.js 37 Dumping ScriptsNavigator 'Scripts' tab: 38 compiled.js 39 foo.js 31 source.js 40 32 Dumping ScriptsNavigator 'Content scripts' tab: 41 33 -
trunk/LayoutTests/inspector/debugger/scripts-panel.html
r117235 r117267 30 30 { 31 31 uiSourceCodes.push(uiSourceCode); 32 this.dispatchEventToListeners(WebInspector. DebuggerScriptMapping.Events.UISourceCodeAdded, uiSourceCode);32 this.dispatchEventToListeners(WebInspector.ScriptMapping.Events.UISourceCodeAdded, uiSourceCode); 33 33 } 34 34 model._reset = function(preservedItems) … … 37 37 WebInspector.debuggerModel.dispatchEventToListeners(WebInspector.DebuggerModel.Events.GlobalObjectCleared); 38 38 } 39 model._replaceUISourceCode s = function(oldUISourceCodeList, newUISourceCodeList)39 model._replaceUISourceCode = function(oldUISourceCode, uiSourceCode) 40 40 { 41 for (var i = 0; i < oldUISourceCodeList.length; ++i) 42 uiSourceCodes.remove(oldUISourceCodeList[i]); 43 for (var i = 0; i < newUISourceCodeList.length; ++i) 44 uiSourceCodes.push(newUISourceCodeList[i]); 45 var data = { oldUISourceCodeList: oldUISourceCodeList, uiSourceCodeList: newUISourceCodeList }; 46 this.dispatchEventToListeners(WebInspector.DebuggerScriptMapping.Events.UISourceCodeReplaced, data); 41 uiSourceCodes.remove(oldUISourceCode); 42 uiSourceCodes.push(uiSourceCode); 43 var data = { oldUISourceCode: oldUISourceCode, uiSourceCode: uiSourceCode }; 44 this.dispatchEventToListeners(WebInspector.ScriptMapping.Events.UISourceCodeReplaced, data); 47 45 } 48 46 return model; … … 110 108 }, 111 109 112 113 110 function testSourceReplaced(next) 114 111 { … … 125 122 126 123 // Plug compiler source mapping. 127 var source1SourceCode = createUISouceCode("source1.js"); 128 var source2SourceCode = createUISouceCode("source2.js"); 129 mapping._replaceUISourceCodes([compiledSourceCode], [source1SourceCode, source2SourceCode]); 124 var sourceSourceCode = createUISouceCode("source.js"); 125 mapping._replaceUISourceCode(compiledSourceCode, sourceSourceCode); 130 126 131 127 InspectorTest.dumpScriptsNavigator(panel._navigator); 132 InspectorTest.showScriptSourceOnScriptsPanel(panel, "source2.js", step2); 133 134 function step2() { 135 InspectorTest.showScriptSourceOnScriptsPanel(panel, "source1.js", step3); 136 } 137 138 function step3() { 139 // Unplug compiler source mapping. 140 mapping._replaceUISourceCodes([source1SourceCode, source2SourceCode], [compiledSourceCode]); 141 InspectorTest.dumpScriptsNavigator(panel._navigator); 142 143 panel.detach(); 144 next(); 145 } 128 next(); 146 129 } 147 130 ]); -
trunk/Source/WebCore/ChangeLog
r117263 r117267 1 2012-05-16 Pavel Feldman <pfeldman@chromium.org> 2 3 Web Inspector: get rid of UISourceCodeListChanged event. 4 https://bugs.webkit.org/show_bug.cgi?id=86601 5 6 Reviewed by Vsevolod Vlasov. 7 8 There was unnecessary conversion between this event and UISourceCodeAdded/Removed/Replaced. 9 10 * inspector/front-end/CompilerScriptMapping.js: 11 (WebInspector.CompilerScriptMapping.prototype.reset): 12 * inspector/front-end/DebuggerScriptMapping.js: 13 (WebInspector.DebuggerScriptMapping): 14 (WebInspector.DebuggerScriptMapping.prototype._handleUISourceCodeAdded): 15 (WebInspector.DebuggerScriptMapping.prototype._handleUISourceCodeReplaced): 16 (WebInspector.DebuggerScriptMapping.prototype._handleUISourceCodeRemoved): 17 * inspector/front-end/NavigatorView.js: 18 * inspector/front-end/ResourceScriptMapping.js: 19 (WebInspector.ResourceScriptMapping.prototype.addScript): 20 (WebInspector.ResourceScriptMapping.prototype._handleUISourceCodeChanged): 21 (WebInspector.ResourceScriptMapping.prototype._uiSourceCodeAdded): 22 (WebInspector.ResourceScriptMapping.prototype._uiSourceCodeReplaced): 23 (WebInspector.ResourceScriptMapping.prototype._uiSourceCodeRemoved): 24 (WebInspector.ResourceScriptMapping.prototype.reset): 25 * inspector/front-end/ScriptMapping.js: 26 * inspector/front-end/ScriptSnippetModel.js: 27 (WebInspector.ScriptSnippetModel.prototype._addScriptSnippet): 28 (WebInspector.ScriptSnippetModel.prototype._createUISourceCodeForScript): 29 (WebInspector.ScriptSnippetModel.prototype._reset): 30 (WebInspector.SnippetScriptMapping.prototype._fireUISourceCodeAdded): 31 (WebInspector.SnippetScriptMapping.prototype._fireUISourceCodeRemoved): 32 * inspector/front-end/ScriptsNavigator.js: 33 (WebInspector.ScriptsNavigator.prototype.replaceUISourceCode): 34 * inspector/front-end/ScriptsPanel.js: 35 (WebInspector.ScriptsPanel.prototype._uiSourceCodeReplaced): 36 * inspector/front-end/TabbedEditorContainer.js: 37 1 38 2012-05-16 Keishi Hattori <keishi@webkit.org> 2 39 -
trunk/Source/WebCore/inspector/front-end/CompilerScriptMapping.js
r116846 r117267 127 127 this._sourceMapForScriptId[script.scriptId] = sourceMap; 128 128 this._scriptForSourceMap.put(sourceMap, script); 129 var data = { removedItems: [], addedItems: uiSourceCodeList };130 this.dispatchEventToListeners(WebInspector.ScriptMapping.Events.UISourceCodeListChanged, data);131 129 script.setSourceMapping(this); 130 131 for (var i = 0; i < uiSourceCodeList.length; ++i) 132 this.dispatchEventToListeners(WebInspector.ScriptMapping.Events.UISourceCodeAdded, uiSourceCodeList[i]); 132 133 }, 133 134 … … 160 161 reset: function() 161 162 { 162 var data = { removedItems: this.uiSourceCodeList(), addedItems: [] }; 163 this.dispatchEventToListeners(WebInspector.ScriptMapping.Events.UISourceCodeListChanged, data); 163 var uiSourceCodes = this.uiSourceCodeList(); 164 for (var i = 0; i < uiSourceCodes.length; ++i) 165 this.dispatchEventToListeners(WebInspector.ScriptMapping.Events.UISourceCodeRemoved, uiSourceCodes[i]); 164 166 165 167 this._sourceMapByURL = {}; -
trunk/Source/WebCore/inspector/front-end/DebuggerScriptMapping.js
r117235 r117267 44 44 this._snippetMapping = WebInspector.scriptSnippetModel.scriptMapping; 45 45 this._mappings.push(this._snippetMapping); 46 47 for (var i = 0; i < this._mappings.length; ++i) 48 this._mappings[i].addEventListener(WebInspector.ScriptMapping.Events.UISourceCodeListChanged, this._handleUISourceCodeListChanged, this); 46 for (var i = 0; i < this._mappings.length; ++i) { 47 this._mappings[i].addEventListener(WebInspector.ScriptMapping.Events.UISourceCodeAdded, this._handleUISourceCodeAdded, this); 48 this._mappings[i].addEventListener(WebInspector.ScriptMapping.Events.UISourceCodeReplaced, this._handleUISourceCodeReplaced, this); 49 this._mappings[i].addEventListener(WebInspector.ScriptMapping.Events.UISourceCodeRemoved, this._handleUISourceCodeRemoved, this); 50 } 49 51 50 52 WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.ParsedScriptSource, this._parsedScriptSource, this); 51 53 WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.FailedToParseScriptSource, this._parsedScriptSource, this); 52 54 WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.GlobalObjectCleared, this._debuggerReset, this); 53 }54 55 WebInspector.DebuggerScriptMapping.Events = {56 UISourceCodeAdded: "source-file-added",57 UISourceCodeReplaced: "source-file-replaced",58 UISourceCodeRemoved: "source-file-removed"59 55 } 60 56 … … 87 83 * @param {WebInspector.Event} event 88 84 */ 89 _handleUISourceCode ListChanged: function(event)85 _handleUISourceCodeAdded: function(event) 90 86 { 91 var removedItems = /** @type {Array.<WebInspector.UISourceCode>} */ event.data["removedItems"];92 var addedItems = /** @type {Array.<WebInspector.UISourceCode>} */ event.data["addedItems"];87 this.dispatchEventToListeners(WebInspector.ScriptMapping.Events.UISourceCodeAdded, event.data); 88 }, 93 89 94 if (!removedItems.length) { 95 for (var i = 0; i < addedItems.length; ++i) 96 this.dispatchEventToListeners(WebInspector.DebuggerScriptMapping.Events.UISourceCodeAdded, addedItems[i]); 97 } else if (!addedItems.length) { 98 for (var i = 0; i < addedItems.length; ++i) 99 this.dispatchEventToListeners(WebInspector.DebuggerScriptMapping.Events.UISourceCodeRemoved, removedItems[i]); 100 } else { 101 var eventData = { uiSourceCodeList: addedItems, oldUISourceCodeList: removedItems }; 102 this.dispatchEventToListeners(WebInspector.DebuggerScriptMapping.Events.UISourceCodeReplaced, eventData); 103 } 90 /** 91 * @param {WebInspector.Event} event 92 */ 93 _handleUISourceCodeReplaced: function(event) 94 { 95 this.dispatchEventToListeners(WebInspector.ScriptMapping.Events.UISourceCodeReplaced, event.data); 96 }, 97 98 /** 99 * @param {WebInspector.Event} event 100 */ 101 _handleUISourceCodeRemoved: function(event) 102 { 103 this.dispatchEventToListeners(WebInspector.ScriptMapping.Events.UISourceCodeRemoved, event.data); 104 104 }, 105 105 -
trunk/Source/WebCore/inspector/front-end/NavigatorView.js
r114753 r117267 127 127 128 128 /** 129 * @param { Array.<WebInspector.UISourceCode>} oldUISourceCodeList130 * @param { Array.<WebInspector.UISourceCode>} uiSourceCodeList131 */ 132 replaceUISourceCode s: function(oldUISourceCodeList, uiSourceCodeList)129 * @param {WebInspector.UISourceCode} oldUISourceCode 130 * @param {WebInspector.UISourceCode} uiSourceCode 131 */ 132 replaceUISourceCode: function(oldUISourceCode, uiSourceCode) 133 133 { 134 134 var added = false; 135 135 var selected = false; 136 for (var i = 0; i < oldUISourceCodeList.length; ++i) { 137 var uiSourceCode = oldUISourceCodeList[i]; 138 if (!this._scriptTreeElementsByUISourceCode.get(uiSourceCode)) 139 continue; 136 if (this._scriptTreeElementsByUISourceCode.get(oldUISourceCode)) { 140 137 added = true; 141 138 142 if (this._lastSelectedUISourceCode === uiSourceCode)139 if (this._lastSelectedUISourceCode === oldUISourceCode) 143 140 selected = true; 144 this._removeUISourceCode( uiSourceCode);145 } 146 141 this._removeUISourceCode(oldUISourceCode); 142 } 143 147 144 if (!added) 148 145 return; 149 150 for (var i = 0; i < uiSourceCodeList.length; ++i) 151 this.addUISourceCode(uiSourceCodeList[i]); 152 146 this.addUISourceCode(uiSourceCode); 153 147 if (selected) 154 this.revealUISourceCode(uiSourceCode List[0]);148 this.revealUISourceCode(uiSourceCode); 155 149 }, 156 150 -
trunk/Source/WebCore/inspector/front-end/ResourceScriptMapping.js
r116775 r117267 120 120 121 121 if (rawSourceCode.uiSourceCode()) 122 this._uiSourceCode Changed(rawSourceCode, null, rawSourceCode.uiSourceCode());122 this._uiSourceCodeAdded(rawSourceCode, rawSourceCode.uiSourceCode()); 123 123 rawSourceCode.addEventListener(WebInspector.RawSourceCode.Events.UISourceCodeChanged, this._handleUISourceCodeChanged, this); 124 124 }, … … 132 132 var uiSourceCode = /** @type {WebInspector.UISourceCode} */ event.data.uiSourceCode; 133 133 var oldUISourceCode = /** @type {WebInspector.UISourceCode} */ event.data.oldUISourceCode; 134 this._uiSourceCodeChanged(rawSourceCode, oldUISourceCode, uiSourceCode); 135 }, 136 137 /** 138 * @param {WebInspector.RawSourceCode} rawSourceCode 139 * @param {WebInspector.UISourceCode} removedItem 140 * @param {WebInspector.UISourceCode} addedItem 141 */ 142 _uiSourceCodeChanged: function(rawSourceCode, removedItem, addedItem) 143 { 144 if (removedItem) 145 this._rawSourceCodeForUISourceCode.remove(removedItem); 146 if (addedItem) 147 this._rawSourceCodeForUISourceCode.put(addedItem, rawSourceCode); 148 149 var scriptIds = []; 150 for (var i = 0; i < rawSourceCode._scripts.length; ++i) { 151 scriptIds.push(rawSourceCode._scripts[i].scriptId); 134 if (!oldUISourceCode) 135 this._uiSourceCodeAdded(rawSourceCode, uiSourceCode); 136 else 137 this._uiSourceCodeReplaced(rawSourceCode, oldUISourceCode, uiSourceCode); 138 }, 139 140 /** 141 * @param {WebInspector.RawSourceCode} rawSourceCode 142 * @paran {WebInspector.UISourceCode} uiSourceCode 143 */ 144 _uiSourceCodeAdded: function(rawSourceCode, uiSourceCode) 145 { 146 this._rawSourceCodeForUISourceCode.put(uiSourceCode, rawSourceCode); 147 148 for (var i = 0; i < rawSourceCode._scripts.length; ++i) 152 149 rawSourceCode._scripts[i].setSourceMapping(this); 153 } 154 var removedItems = removedItem ? [removedItem] : []; 155 var addedItems = addedItem ? [addedItem] : []; 156 157 var data = { removedItems: removedItems, addedItems: addedItems }; 158 this.dispatchEventToListeners(WebInspector.ScriptMapping.Events.UISourceCodeListChanged, data); 150 151 this.dispatchEventToListeners(WebInspector.ScriptMapping.Events.UISourceCodeAdded, uiSourceCode); 152 }, 153 154 /** 155 * @param {WebInspector.RawSourceCode} rawSourceCode 156 * @param {WebInspector.UISourceCode} oldUISourceCode 157 * @param {WebInspector.UISourceCode} uiSourceCode 158 */ 159 _uiSourceCodeReplaced: function(rawSourceCode, oldUISourceCode, uiSourceCode) 160 { 161 this._rawSourceCodeForUISourceCode.remove(oldUISourceCode); 162 this._rawSourceCodeForUISourceCode.put(uiSourceCode, rawSourceCode); 163 164 for (var i = 0; i < rawSourceCode._scripts.length; ++i) 165 rawSourceCode._scripts[i].setSourceMapping(this); 166 167 var data = { oldUISourceCode: uiSourceCode, uiSourceCode: uiSourceCode }; 168 this.dispatchEventToListeners(WebInspector.ScriptMapping.Events.UISourceCodeReplaced, data); 169 }, 170 171 /** 172 * @param {WebInspector.RawSourceCode} rawSourceCode 173 * @paran {WebInspector.UISourceCode} uiSourceCode 174 */ 175 _uiSourceCodeRemoved: function(rawSourceCode, uiSourceCode) 176 { 177 this._rawSourceCodeForUISourceCode.remove(uiSourceCode); 178 this.dispatchEventToListeners(WebInspector.ScriptMapping.Events.UISourceCodeRemoved, uiSourceCode); 159 179 }, 160 180 … … 174 194 for (var i = 0; i < this._rawSourceCodes.length; ++i) { 175 195 var rawSourceCode = this._rawSourceCodes[i]; 176 this._uiSourceCode Changed(rawSourceCode, rawSourceCode.uiSourceCode(), null);196 this._uiSourceCodeRemoved(rawSourceCode, rawSourceCode.uiSourceCode()); 177 197 rawSourceCode.removeAllListeners(); 178 198 } -
trunk/Source/WebCore/inspector/front-end/ScriptMapping.js
r116843 r117267 98 98 99 99 WebInspector.ScriptMapping.Events = { 100 UISourceCodeListChanged: "ui-source-code-list-changed" 100 UISourceCodeAdded: "UISourceCodeAdded", 101 UISourceCodeReplaced: "UISourceCodeReplaced", 102 UISourceCodeRemoved: "UISourceCodeRemoved" 101 103 } 102 104 -
trunk/Source/WebCore/inspector/front-end/ScriptSnippetModel.js
r117065 r117267 82 82 this._uiSourceCodeForSnippet.put(snippet, uiSourceCode); 83 83 this._snippetForUISourceCode.put(uiSourceCode, snippet); 84 this._snippetScriptMapping._ uiSourceCodesAdded([uiSourceCode]);84 this._snippetScriptMapping._fireUISourceCodeAdded(uiSourceCode); 85 85 return uiSourceCode; 86 86 }, … … 96 96 this._uiSourceCodeForSnippet.remove(snippet); 97 97 this._snippetForUISourceCode.remove(uiSourceCode); 98 this._snippetScriptMapping._ uiSourceCodesRemoved([uiSourceCode]);98 this._snippetScriptMapping._fireUISourceCodeRemoved(uiSourceCode); 99 99 }, 100 100 … … 220 220 this._uiSourceCodeForScriptId[script.scriptId] = uiSourceCode; 221 221 this._scriptForUISourceCode.put(uiSourceCode, script); 222 this._snippetScriptMapping._ uiSourceCodesAdded([uiSourceCode]);222 this._snippetScriptMapping._fireUISourceCodeAdded(uiSourceCode); 223 223 script.setSourceMapping(this._snippetScriptMapping); 224 224 }, … … 285 285 this._uiSourceCodeForScriptId = {}; 286 286 this._scriptForUISourceCode = new Map(); 287 this._snippetScriptMapping._uiSourceCodesRemoved(removedUISourceCodes); 287 for (var i = 0; i < removedUISourceCodes.length; ++i) 288 this._snippetScriptMapping._fireUISourceCodeRemoved(removedUISourceCodes[i]); 288 289 } 289 290 } … … 348 349 349 350 /** 350 * @param {Array.<WebInspector.UISourceCode>} uiSourceCodes 351 */ 352 _uiSourceCodesAdded: function(uiSourceCodes) 353 { 354 var data = { removedItems: [], addedItems: uiSourceCodes }; 355 this.dispatchEventToListeners(WebInspector.ScriptMapping.Events.UISourceCodeListChanged, data); 356 }, 357 358 /** 359 * @param {Array.<WebInspector.UISourceCode>} uiSourceCodes 360 */ 361 _uiSourceCodesRemoved: function(uiSourceCodes) 362 { 363 var data = { removedItems: uiSourceCodes, addedItems: [] }; 364 this.dispatchEventToListeners(WebInspector.ScriptMapping.Events.UISourceCodeListChanged, data); 351 * @param {WebInspector.UISourceCode} uiSourceCode 352 */ 353 _fireUISourceCodeAdded: function(uiSourceCode) 354 { 355 this.dispatchEventToListeners(WebInspector.ScriptMapping.Events.UISourceCodeAdded, uiSourceCode); 356 }, 357 358 /** 359 * @param {WebInspector.UISourceCode} uiSourceCode 360 */ 361 _fireUISourceCodeRemoved: function(uiSourceCode) 362 { 363 this.dispatchEventToListeners(WebInspector.ScriptMapping.Events.UISourceCodeRemoved, uiSourceCode); 365 364 }, 366 365 -
trunk/Source/WebCore/inspector/front-end/ScriptsNavigator.js
r114753 r117267 125 125 126 126 /** 127 * @param { Array.<WebInspector.UISourceCode>} oldUISourceCodeList128 * @param { Array.<WebInspector.UISourceCode>} uiSourceCodeList129 */ 130 replaceUISourceCode s: function(oldUISourceCodeList, uiSourceCodeList)131 { 132 this._scriptsView.replaceUISourceCode s(oldUISourceCodeList, uiSourceCodeList);133 this._contentScriptsView.replaceUISourceCode s(oldUISourceCodeList, uiSourceCodeList);134 this._snippetsView.replaceUISourceCode s(oldUISourceCodeList, uiSourceCodeList);127 * @param {WebInspector.UISourceCode} oldUISourceCode 128 * @param {WebInspector.UISourceCode} uiSourceCode 129 */ 130 replaceUISourceCode: function(oldUISourceCode, uiSourceCode) 131 { 132 this._scriptsView.replaceUISourceCode(oldUISourceCode, uiSourceCode); 133 this._contentScriptsView.replaceUISourceCode(oldUISourceCode, uiSourceCode); 134 this._snippetsView.replaceUISourceCode(oldUISourceCode, uiSourceCode); 135 135 }, 136 136 -
trunk/Source/WebCore/inspector/front-end/ScriptsPanel.js
r117235 r117267 170 170 WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.BreakpointsActiveStateChanged, this._breakpointsActiveStateChanged, this); 171 171 172 this._scriptMapping.addEventListener(WebInspector. DebuggerScriptMapping.Events.UISourceCodeAdded, this._handleUISourceCodeAdded, this);173 this._scriptMapping.addEventListener(WebInspector. DebuggerScriptMapping.Events.UISourceCodeReplaced, this._uiSourceCodeReplaced, this);174 this._scriptMapping.addEventListener(WebInspector. DebuggerScriptMapping.Events.UISourceCodeRemoved, this._uiSourceCodeRemoved, this);172 this._scriptMapping.addEventListener(WebInspector.ScriptMapping.Events.UISourceCodeAdded, this._handleUISourceCodeAdded, this); 173 this._scriptMapping.addEventListener(WebInspector.ScriptMapping.Events.UISourceCodeReplaced, this._uiSourceCodeReplaced, this); 174 this._scriptMapping.addEventListener(WebInspector.ScriptMapping.Events.UISourceCodeRemoved, this._uiSourceCodeRemoved, this); 175 175 176 176 var enableDebugger = !Capabilities.debuggerCausesRecompilation || WebInspector.settings.debuggerEnabled.get(); … … 495 495 _uiSourceCodeReplaced: function(event) 496 496 { 497 var oldUISourceCodeList = /** @type {Array.<WebInspector.UISourceCode>} */ event.data.oldUISourceCodeList; 498 var uiSourceCodeList = /** @type {Array.<WebInspector.UISourceCode>} */ event.data.uiSourceCodeList; 499 500 this._navigator.replaceUISourceCodes(oldUISourceCodeList, uiSourceCodeList); 501 this._editorContainer.replaceFiles(oldUISourceCodeList, uiSourceCodeList); 502 for (var i = 0; i < oldUISourceCodeList.length; ++i) 503 this._removeSourceFrame(oldUISourceCodeList[i]); 497 var oldUISourceCode = /** @type {WebInspector.UISourceCode} */ event.data.oldUISourceCode; 498 var uiSourceCode = /** @type {WebInspector.UISourceCode} */ event.data.uiSourceCode; 499 500 this._navigator.replaceUISourceCode(oldUISourceCode, uiSourceCode); 501 this._editorContainer.replaceFile(oldUISourceCode, uiSourceCode); 502 this._removeSourceFrame(oldUISourceCode); 504 503 }, 505 504 -
trunk/Source/WebCore/inspector/front-end/TabbedEditorContainer.js
r114740 r117267 267 267 /** 268 268 * @param {WebInspector.UISourceCode} oldUISourceCode 269 * @param {WebInspector.UISourceCode} newUISourceCode270 */ 271 _replaceFileTab: function(oldUISourceCode, newUISourceCode)269 * @param {WebInspector.UISourceCode} uiSourceCode 270 */ 271 replaceFile: function(oldUISourceCode, uiSourceCode) 272 272 { 273 273 var tabId = this._tabIds.get(oldUISourceCode); … … 278 278 delete this._files[this._tabIds.get(oldUISourceCode)] 279 279 this._tabIds.remove(oldUISourceCode); 280 this._tabIds.put(newUISourceCode, tabId); 281 this._files[tabId] = newUISourceCode; 282 283 this._tabbedPane.changeTabTitle(tabId, this._titleForFile(newUISourceCode)); 284 this._tabbedPane.changeTabView(tabId, this._delegate.viewForFile(newUISourceCode)); 285 this._tabbedPane.changeTabTooltip(tabId, this._tooltipForFile(newUISourceCode)); 286 }, 287 288 /** 289 * @param {Array.<WebInspector.UISourceCode>} oldUISourceCodeList 290 * @param {Array.<WebInspector.UISourceCode>} uiSourceCodeList 291 */ 292 replaceFiles: function(oldUISourceCodeList, uiSourceCodeList) 293 { 294 var mainFile; 295 for (var i = 0; i < oldUISourceCodeList.length; ++i) { 296 var tabId = this._tabIds.get(oldUISourceCodeList[i]); 297 if (tabId && (!mainFile || this._tabbedPane.selectedTabId === tabId)) { 298 mainFile = oldUISourceCodeList[i]; 299 break; 300 } 301 } 302 303 if (!mainFile) 304 return; 305 306 this._replaceFileTab(mainFile, uiSourceCodeList[0]); 307 for (var i = 0; i < oldUISourceCodeList.length; ++i) 308 this._removeFileTab(oldUISourceCodeList[i]); 309 }, 310 280 this._tabIds.put(uiSourceCode, tabId); 281 this._files[tabId] = uiSourceCode; 282 283 this._tabbedPane.changeTabTitle(tabId, this._titleForFile(uiSourceCode)); 284 this._tabbedPane.changeTabView(tabId, this._delegate.viewForFile(uiSourceCode)); 285 this._tabbedPane.changeTabTooltip(tabId, this._tooltipForFile(uiSourceCode)); 286 }, 287 311 288 /** 312 289 * @param {WebInspector.UISourceCode} uiSourceCode
Note: See TracChangeset
for help on using the changeset viewer.