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

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

Issue 667623002: DevTools: make extension server a part of core, panels' code should depend on it. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: for review Created 6 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: 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 fbf4db7cde3db485ac2855164ed0a605f35f95db..ba0861d58a09ffa9e85457dc063d144cdb134888 100644
--- a/Source/devtools/front_end/sources/SourcesPanel.js
+++ b/Source/devtools/front_end/sources/SourcesPanel.js
@@ -108,6 +108,7 @@ WebInspector.SourcesPanel = function(workspaceForTest)
WebInspector.targetManager.addModelListener(WebInspector.DebuggerModel, WebInspector.DebuggerModel.Events.GlobalObjectCleared, this._debuggerReset, this);
WebInspector.targetManager.observeTargets(this);
new WebInspector.WorkspaceMappingTip(this, this._workspace);
+ WebInspector.extensionServer.addEventListener(WebInspector.ExtensionServer.Events.SidebarPaneAdded, this._extensionSidebarPaneAdded, this);
}
WebInspector.SourcesPanel.minToolbarWidth = 215;
@@ -1069,8 +1070,10 @@ WebInspector.SourcesPanel.prototype = {
this.sidebarPaneView = splitView;
}
- for (var i = 0; i < this._extensionSidebarPanes.length; ++i)
- this._extensionSidebarPanesContainer.addPane(this._extensionSidebarPanes[i]);
+
+ var extensionSidebarPanes = WebInspector.extensionServer.sidebarPanes();
+ for (var i = 0; i < extensionSidebarPanes.length; ++i)
+ this._addExtensionSidebarPane(extensionSidebarPanes[i]);
this.sidebarPaneView.show(this._splitView.sidebarElement());
this.sidebarPanes.threads.expand();
@@ -1084,14 +1087,23 @@ WebInspector.SourcesPanel.prototype = {
},
/**
- * @param {string} id
- * @param {!WebInspector.SidebarPane} pane
+ * @param {!WebInspector.Event} event
+ */
+ _extensionSidebarPaneAdded: function(event)
+ {
+ var pane = /** @type {!WebInspector.ExtensionSidebarPane} */ (event.data);
+ this._addExtensionSidebarPane(pane);
+ },
+
+ /**
+ * @param {!WebInspector.ExtensionSidebarPane} pane
*/
- addExtensionSidebarPane: function(id, pane)
+ _addExtensionSidebarPane: function(pane)
{
- this._extensionSidebarPanes.push(pane);
- this._extensionSidebarPanesContainer.addPane(pane);
- this.setHideOnDetach();
+ if (pane.panelName() === this.name) {
+ this.setHideOnDetach();
+ this._extensionSidebarPanesContainer.addPane(pane);
+ }
},
/**

Powered by Google App Engine
This is Rietveld 408576698