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

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

Issue 2431223003: [DevTools]: Require explicit connection (Closed)
Patch Set: Addressed one last comment Created 4 years, 1 month 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 c4cb5bd8043d1af8c1a78484102bfb392ee35eec..8af370ce7610a981b24dd788796cf8a4a25a1ea1 100644
--- a/third_party/WebKit/Source/devtools/front_end/sources/SourcesPanel.js
+++ b/third_party/WebKit/Source/devtools/front_end/sources/SourcesPanel.js
@@ -122,6 +122,8 @@ WebInspector.SourcesPanel = class extends WebInspector.Panel {
WebInspector.DebuggerModel, WebInspector.DebuggerModel.Events.DebuggerResumed, this._debuggerResumed, this);
WebInspector.targetManager.addModelListener(
WebInspector.DebuggerModel, WebInspector.DebuggerModel.Events.GlobalObjectCleared, this._debuggerReset, this);
+ WebInspector.targetManager.addModelListener(
+ WebInspector.SubTargetsManager, WebInspector.SubTargetsManager.Events.PendingTargetAdded, this._pendingTargetAdded, this);
new WebInspector.WorkspaceMappingTip(this, this._workspace);
WebInspector.extensionServer.addEventListener(
WebInspector.ExtensionServer.Events.SidebarPaneAdded, this._extensionSidebarPaneAdded, this);
@@ -165,14 +167,7 @@ WebInspector.SourcesPanel = class extends WebInspector.Panel {
* @param {!WebInspector.Target} target
*/
targetAdded(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();
}
/**
@@ -182,6 +177,19 @@ WebInspector.SourcesPanel = class extends WebInspector.Panel {
targetRemoved(target) {
}
+ _pendingTargetAdded() {
+ this._showThreadsIfNeeded();
+ }
+
+ _showThreadsIfNeeded() {
+ if (WebInspector.ThreadsSidebarPane.shouldBeShown() && !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