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

Unified Diff: third_party/WebKit/Source/devtools/front_end/sources/TabbedEditorContainer.js

Issue 2384783003: DevTools: split Sources tree into Network and Filesystem trees. (Closed)
Patch Set: review comments addressed 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 side-by-side diff with in-line comments
Download patch
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();
},

Powered by Google App Engine
This is Rietveld 408576698