Index: chrome_linux64/resources/inspector/devtools_extension_api.js |
=================================================================== |
--- chrome_linux64/resources/inspector/devtools_extension_api.js (revision 237140) |
+++ chrome_linux64/resources/inspector/devtools_extension_api.js (working copy) |
@@ -61,7 +61,7 @@ |
AuditStarted: "audit-started-", |
ButtonClicked: "button-clicked-", |
ConsoleMessageAdded: "console-message-added", |
- ElementsPanelObjectSelected: "panel-objectSelected-elements", |
+ PanelObjectSelected: "panel-objectSelected-", |
NetworkRequestFinished: "network-request-finished", |
OpenResource: "open-resource", |
PanelSearch: "panel-search-", |
@@ -274,7 +274,8 @@ |
function Panels() |
{ |
var panels = { |
- elements: new ElementsPanel() |
+ elements: new ElementsPanel(), |
+ sources: new SourcesPanel(), |
}; |
function panelGetter(name) |
@@ -344,7 +345,10 @@ |
function dispatchShowEvent(message) |
{ |
var frameIndex = message.arguments[0]; |
- this._fire(window.parent.frames[frameIndex]); |
+ if (typeof frameIndex === "number") |
+ this._fire(window.parent.frames[frameIndex]); |
+ else |
+ this._fire(); |
} |
this.onShown = new EventSink(events.ViewShown + id, dispatchShowEvent); |
this.onHidden = new EventSink(events.ViewHidden + id); |
@@ -353,9 +357,10 @@ |
/** |
* @constructor |
*/ |
-function PanelWithSidebarImpl(id) |
+function PanelWithSidebarImpl(hostPanelName) |
{ |
- this._id = id; |
+ this._hostPanelName = hostPanelName; |
+ this.onSelectionChanged = new EventSink(events.PanelObjectSelected + hostPanelName); |
} |
PanelWithSidebarImpl.prototype = { |
@@ -364,7 +369,7 @@ |
var id = "extension-sidebar-" + extensionServer.nextObjectId(); |
var request = { |
command: commands.CreateSidebarPane, |
- panel: this._id, |
+ panel: this._hostPanelName, |
id: id, |
title: title |
}; |
@@ -384,13 +389,20 @@ |
*/ |
function ElementsPanel() |
{ |
- var id = "elements"; |
- PanelWithSidebar.call(this, id); |
- this.onSelectionChanged = new EventSink(events.ElementsPanelObjectSelected); |
+ PanelWithSidebar.call(this, "elements"); |
} |
/** |
* @constructor |
+ * @extends {PanelWithSidebar} |
+ */ |
+function SourcesPanel() |
+{ |
+ PanelWithSidebar.call(this, "sources"); |
+} |
+ |
+/** |
+ * @constructor |
* @extends {ExtensionViewImpl} |
*/ |
function ExtensionPanelImpl(id) |