Chromium Code Reviews| Index: third_party/WebKit/Source/devtools/front_end/sources/SourcesPanel.js |
| diff --git a/third_party/WebKit/Source/devtools/front_end/sources/SourcesPanel.js b/third_party/WebKit/Source/devtools/front_end/sources/SourcesPanel.js |
| index 0a2d8db714e87a240de52a7269e22306bad54b79..2e6259e9a078904f9b566043855411ce73a7c920 100644 |
| --- a/third_party/WebKit/Source/devtools/front_end/sources/SourcesPanel.js |
| +++ b/third_party/WebKit/Source/devtools/front_end/sources/SourcesPanel.js |
| @@ -112,6 +112,7 @@ WebInspector.SourcesPanel = function() |
| WebInspector.extensionServer.addEventListener(WebInspector.ExtensionServer.Events.SidebarPaneAdded, this._extensionSidebarPaneAdded, this); |
| WebInspector.DataSaverInfobar.maybeShowInPanel(this); |
| WebInspector.targetManager.observeTargets(this); |
| + WebInspector.targetConnectionManager.addEventListener(WebInspector.TargetConnectionManager.Events.ConnectionAdded, this._connectionAdded, this); |
| }; |
| WebInspector.SourcesPanel._lastModificationTimeout = 200; |
| @@ -125,13 +126,7 @@ WebInspector.SourcesPanel.prototype = { |
| */ |
| targetAdded: function(target) |
| { |
| - var hasThreads = WebInspector.targetManager.targets(WebInspector.Target.Capability.JS).length > 1; |
| - if (hasThreads && !this._threadsSidebarPane) { |
| - this._threadsSidebarPane = /** @type {!WebInspector.View} */ (WebInspector.viewManager.view("sources.threads")); |
| - if (this._sidebarPaneStack) { |
| - this._sidebarPaneStack.showView(this._threadsSidebarPane, this._splitWidget.isVertical() ? this._watchSidebarPane : this._callstackPane); |
| - } |
| - } |
| + this._showThreadsIfNeeded(); |
| }, |
| /** |
| @@ -142,6 +137,22 @@ WebInspector.SourcesPanel.prototype = { |
| { |
| }, |
| + _connectionAdded: function() |
| + { |
| + this._showThreadsIfNeeded(); |
| + }, |
| + |
| + _showThreadsIfNeeded: function() |
| + { |
| + var hasThreads = WebInspector.targetManager.targets(WebInspector.Target.Capability.JS).length > 1 || WebInspector.targetConnectionManager.connections().length > 0; |
|
dgozman
2016/10/26 22:14:06
I think this is complicated enough to justify stat
|
| + if (hasThreads && !this._threadsSidebarPane) { |
| + this._threadsSidebarPane = /** @type {!WebInspector.View} */ (WebInspector.viewManager.view("sources.threads")); |
| + if (this._sidebarPaneStack) { |
| + this._sidebarPaneStack.showView(this._threadsSidebarPane, this._splitWidget.isVertical() ? this._watchSidebarPane : this._callstackPane); |
| + } |
| + } |
| + }, |
| + |
| /** |
| * @param {?WebInspector.Target} target |
| */ |