Index: Source/devtools/front_end/sources/SourcesPanel.js |
diff --git a/Source/devtools/front_end/sources/SourcesPanel.js b/Source/devtools/front_end/sources/SourcesPanel.js |
index c84ac4472133ca52bce5ba4fe069491568d6c6d6..95619124feb75938afb73472b1561b18d6d9e5bd 100644 |
--- a/Source/devtools/front_end/sources/SourcesPanel.js |
+++ b/Source/devtools/front_end/sources/SourcesPanel.js |
@@ -44,6 +44,8 @@ importScript("StyleSheetOutlineDialog.js"); |
importScript("TabbedEditorContainer.js"); |
importScript("WatchExpressionsSidebarPane.js"); |
importScript("WorkersSidebarPane.js"); |
+importScript("ThreadsSidebarPane.js"); |
+ |
importScript("ScriptFormatterEditorAction.js"); |
importScript("InplaceFormatterEditorAction.js"); |
importScript("ScriptFormatter.js"); |
@@ -56,8 +58,9 @@ importScript("SourcesSearchScope.js"); |
/** |
* @constructor |
- * @implements {WebInspector.ContextMenu.Provider} |
* @extends {WebInspector.Panel} |
+ * @implements {WebInspector.ContextMenu.Provider} |
+ * @implements {WebInspector.TargetManager.Observer} |
* @param {!WebInspector.Workspace=} workspaceForTest |
*/ |
WebInspector.SourcesPanel = function(workspaceForTest) |
@@ -70,9 +73,6 @@ WebInspector.SourcesPanel = function(workspaceForTest) |
this.debugToolbar = this._createDebugToolbar(); |
this._debugToolbarDrawer = this._createDebugToolbarDrawer(); |
- this._targetsToolbar = new WebInspector.StatusBarComboBox(null, "targets-select"); |
- this._targetsToolbar.element.id = "targets-toolbar"; |
- this._targetsComboBoxController = new WebInspector.TargetsComboBoxController(this._targetsToolbar.selectElement(), this._targetsToolbar.element); |
const initialDebugSidebarWidth = 225; |
this._splitView = new WebInspector.SplitView(true, true, "sourcesPanelSplitViewState", initialDebugSidebarWidth); |
@@ -106,6 +106,7 @@ WebInspector.SourcesPanel = function(workspaceForTest) |
this._splitView.installResizer(this._debugSidebarResizeWidgetElement); |
this.sidebarPanes = {}; |
+ this.sidebarPanes.threads = new WebInspector.ThreadsSidebarPane(); |
this.sidebarPanes.watchExpressions = new WebInspector.WatchExpressionsSidebarPane(); |
this.sidebarPanes.callstack = new WebInspector.CallStackSidebarPane(); |
this.sidebarPanes.callstack.addEventListener(WebInspector.CallStackSidebarPane.Events.CallFrameSelected, this._callFrameSelectedInSidebar.bind(this)); |
@@ -117,7 +118,7 @@ WebInspector.SourcesPanel = function(workspaceForTest) |
this.sidebarPanes.xhrBreakpoints = new WebInspector.XHRBreakpointsSidebarPane(); |
this.sidebarPanes.eventListenerBreakpoints = new WebInspector.EventListenerBreakpointsSidebarPane(); |
- if (!WebInspector.isWorkerFrontend()) |
+ if (!WebInspector.isWorkerFrontend() && !WebInspector.experimentsSettings.workersInMainWindow.isEnabled()) |
this.sidebarPanes.workerList = new WebInspector.WorkersSidebarPane(); |
this._extensionSidebarPanes = []; |
@@ -140,6 +141,7 @@ WebInspector.SourcesPanel = function(workspaceForTest) |
WebInspector.targetManager.addModelListener(WebInspector.DebuggerModel, WebInspector.DebuggerModel.Events.CallFrameSelected, this._callFrameSelected, this); |
WebInspector.targetManager.addModelListener(WebInspector.DebuggerModel, WebInspector.DebuggerModel.Events.ConsoleCommandEvaluatedInSelectedCallFrame, this._consoleCommandEvaluatedInSelectedCallFrame, this); |
WebInspector.targetManager.addModelListener(WebInspector.DebuggerModel, WebInspector.DebuggerModel.Events.GlobalObjectCleared, this._debuggerReset, this); |
+ WebInspector.targetManager.observeTargets(this); |
} |
WebInspector.SourcesPanel.minToolbarWidth = 215; |
@@ -1072,7 +1074,6 @@ WebInspector.SourcesPanel.prototype = { |
var vbox = new WebInspector.VBox(); |
vbox.element.appendChild(this._debugToolbarDrawer); |
vbox.element.appendChild(this.debugToolbar); |
- vbox.element.appendChild(this._targetsToolbar.element); |
vbox.setMinimumAndPreferredSizes(25, 25, WebInspector.SourcesPanel.minToolbarWidth, 100); |
var sidebarPaneStack = new WebInspector.SidebarPaneStack(); |
sidebarPaneStack.element.classList.add("flex-auto"); |
@@ -1083,13 +1084,13 @@ WebInspector.SourcesPanel.prototype = { |
for (var pane in this.sidebarPanes) |
sidebarPaneStack.addPane(this.sidebarPanes[pane]); |
this._extensionSidebarPanesContainer = sidebarPaneStack; |
- |
this.sidebarPaneView = vbox; |
} else { |
var splitView = new WebInspector.SplitView(true, true, "sourcesPanelDebuggerSidebarSplitViewState", 0.5); |
vbox.show(splitView.mainElement()); |
// Populate the left stack. |
+ sidebarPaneStack.addPane(this.sidebarPanes.threads); |
sidebarPaneStack.addPane(this.sidebarPanes.callstack); |
sidebarPaneStack.addPane(this.sidebarPanes.jsBreakpoints); |
sidebarPaneStack.addPane(this.sidebarPanes.domBreakpoints); |
@@ -1110,11 +1111,12 @@ WebInspector.SourcesPanel.prototype = { |
this._extensionSidebarPanesContainer.addPane(this._extensionSidebarPanes[i]); |
this.sidebarPaneView.show(this._splitView.sidebarElement()); |
- |
+ this.sidebarPanes.threads.expand(); |
this.sidebarPanes.scopechain.expand(); |
this.sidebarPanes.jsBreakpoints.expand(); |
this.sidebarPanes.callstack.expand(); |
- |
+ this._sidebarPaneStack = sidebarPaneStack; |
+ this._updateTargetsSidebarVisibility(); |
if (WebInspector.settings.watchExpressions.get().length > 0) |
this.sidebarPanes.watchExpressions.expand(); |
}, |
@@ -1138,6 +1140,29 @@ WebInspector.SourcesPanel.prototype = { |
return this._sourcesView; |
}, |
+ /** |
+ * @param {!WebInspector.Target} target |
+ */ |
+ targetAdded: function(target) |
+ { |
+ this._updateTargetsSidebarVisibility(); |
+ }, |
+ |
+ /** |
+ * @param {!WebInspector.Target} target |
+ */ |
+ targetRemoved: function(target) |
+ { |
+ this._updateTargetsSidebarVisibility(); |
+ }, |
+ |
+ _updateTargetsSidebarVisibility: function() |
+ { |
+ if (!this._sidebarPaneStack) |
+ return; |
+ this._sidebarPaneStack.togglePaneHidden(this.sidebarPanes.threads, WebInspector.targetManager.targets().length < 2); |
+ }, |
+ |
__proto__: WebInspector.Panel.prototype |
} |