Index: third_party/WebKit/Source/devtools/front_end/sources/TabbedEditorContainer.js |
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/TabbedEditorContainer.js b/third_party/WebKit/Source/devtools/front_end/sources/TabbedEditorContainer.js |
index 513c212138cd1e9bb71466893dc77ded705d2069..f423c4a2cf5f7711c7151390ba14b5b364848fb2 100644 |
--- a/third_party/WebKit/Source/devtools/front_end/sources/TabbedEditorContainer.js |
+++ b/third_party/WebKit/Source/devtools/front_end/sources/TabbedEditorContainer.js |
@@ -88,21 +88,24 @@ WebInspector.TabbedEditorContainer.prototype = { |
_onBindingCreated: function(event) |
{ |
var binding = /** @type {!WebInspector.PersistenceBinding} */(event.data); |
+ var networkTabId = this._tabIds.get(binding.network); |
var fileSystemTabId = this._tabIds.get(binding.fileSystem); |
- if (!fileSystemTabId) |
- return; |
+ var wasSelectedInFileSystem = this._currentFile === binding.fileSystem; |
+ |
+ if (fileSystemTabId) { |
+ var tabIndex = this._tabbedPane.tabIndex(fileSystemTabId); |
+ this._closeTabs([fileSystemTabId]); |
+ } |
- var isSelected = this._currentFile === binding.fileSystem; |
- var tabIndex = this._tabbedPane.tabIndex(fileSystemTabId); |
- this._closeTabs([fileSystemTabId]); |
- var networkTabId = this._tabIds.get(binding.network); |
if (networkTabId) { |
- if (isSelected) |
+ if (wasSelectedInFileSystem) |
this._tabbedPane.selectTab(networkTabId, false); |
+ this._tabbedPane.changeTabTitle(networkTabId, this._titleForFile(binding.fileSystem), this._tooltipForFile(binding.fileSystem)); |
return; |
} |
+ |
var tabId = this._appendFileTab(binding.network, false, tabIndex); |
- if (isSelected) |
+ if (wasSelectedInFileSystem) |
this._tabbedPane.selectTab(tabId, false); |
}, |
@@ -287,6 +290,7 @@ WebInspector.TabbedEditorContainer.prototype = { |
*/ |
_titleForFile: function(uiSourceCode) |
{ |
+ uiSourceCode = WebInspector.persistence.fileSystem(uiSourceCode) || uiSourceCode; |
var maxDisplayNameLength = 30; |
var title = uiSourceCode.displayName(true).trimMiddle(maxDisplayNameLength); |
if (uiSourceCode.isDirty() || WebInspector.persistence.hasUnsavedCommittedChanges(uiSourceCode)) |
@@ -438,6 +442,7 @@ WebInspector.TabbedEditorContainer.prototype = { |
*/ |
_tooltipForFile: function(uiSourceCode) |
{ |
+ uiSourceCode = WebInspector.persistence.fileSystem(uiSourceCode) || uiSourceCode; |
return uiSourceCode.url(); |
}, |