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

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

Issue 2431223003: [DevTools]: Require explicit connection (Closed)
Patch Set: Fixed Node.JS connection title 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/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
*/

Powered by Google App Engine
This is Rietveld 408576698