diff options
Diffstat (limited to 'WebCore/inspector/front-end/ExtensionAPI.js')
-rw-r--r-- | WebCore/inspector/front-end/ExtensionAPI.js | 45 |
1 files changed, 43 insertions, 2 deletions
diff --git a/WebCore/inspector/front-end/ExtensionAPI.js b/WebCore/inspector/front-end/ExtensionAPI.js index 5d090b0..7d6d76c 100644 --- a/WebCore/inspector/front-end/ExtensionAPI.js +++ b/WebCore/inspector/front-end/ExtensionAPI.js @@ -197,6 +197,19 @@ PanelImpl.prototype = { callback(new ExtensionSidebarPane(id)); } extensionServer.sendRequest({ command: "createSidebarPane", panel: this._id, id: id, title: title, url: expandURL(url) }, callback && callbackWrapper); + }, + + createWatchExpressionSidebarPane: function(title, callback) + { + var id = "watch-sidebar-" + extensionServer.nextObjectId(); + function callbackWrapper(result) + { + if (result.isError) + callback(result); + else + callback(new WatchExpressionSidebarPane(id)); + } + extensionServer.sendRequest({ command: "createWatchExpressionSidebarPane", panel: this._id, id: id, title: title }, callback && callbackWrapper); } } @@ -204,6 +217,7 @@ function Panel(id) { var impl = new PanelImpl(id); this.createSidebarPane = bind(impl.createSidebarPane, impl); + this.createWatchExpressionSidebarPane = bind(impl.createWatchExpressionSidebarPane, impl); this.onSelectionChanged = new EventSink("panel-objectSelected-" + id); } @@ -235,13 +249,40 @@ ExtensionSidebarPaneImpl.prototype = { } } -function ExtensionSidebarPane(id) +function ExtensionSidebarPane(id, impl) { - var impl = new ExtensionSidebarPaneImpl(id); + if (!impl) + impl = new ExtensionSidebarPaneImpl(id); this.setHeight = bind(impl.setHeight, impl); this.setExpanded = bind(impl.setExpanded, impl); } +function WatchExpressionSidebarPaneImpl(id) +{ + ExtensionSidebarPaneImpl.call(this, id); +} + +WatchExpressionSidebarPaneImpl.prototype = { + setExpression: function(expression, rootTitle) + { + extensionServer.sendRequest({ command: "setWatchSidebarContent", id: this._id, expression: expression, rootTitle: rootTitle, evaluateOnPage: true }); + }, + + setObject: function(jsonObject, rootTitle) + { + extensionServer.sendRequest({ command: "setWatchSidebarContent", id: this._id, expression: jsonObject, rootTitle: rootTitle }); + } +} + +function WatchExpressionSidebarPane(id) +{ + var impl = new WatchExpressionSidebarPaneImpl(id); + ExtensionSidebarPane.call(this, id, impl); + this.setExpression = bind(impl.setExpression, impl); + this.setObject = bind(impl.setObject, impl); + this.onUpdated = new EventSink("watch-sidebar-updated-" + id); +} + function Audits() { } |