summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/inspector/front-end/ExtensionAPI.js
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/inspector/front-end/ExtensionAPI.js')
-rw-r--r--Source/WebCore/inspector/front-end/ExtensionAPI.js58
1 files changed, 15 insertions, 43 deletions
diff --git a/Source/WebCore/inspector/front-end/ExtensionAPI.js b/Source/WebCore/inspector/front-end/ExtensionAPI.js
index ea7324c..940e340 100644
--- a/Source/WebCore/inspector/front-end/ExtensionAPI.js
+++ b/Source/WebCore/inspector/front-end/ExtensionAPI.js
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
+ * Copyright (C) 2011 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -111,6 +111,7 @@ function Resources()
this._fire(resource);
}
this.onFinished = new EventSink("resource-finished", resourceDispatch);
+ this.onNavigated = new EventSink("inspectedURLChanged");
}
Resources.prototype = {
@@ -182,6 +183,8 @@ Panels.prototype = {
function PanelImpl(id)
{
this._id = id;
+ this.onShown = new EventSink("panel-shown-" + id);
+ this.onHidden = new EventSink("panel-hidden-" + id);
}
function PanelWithSidebarImpl(id)
@@ -190,35 +193,18 @@ function PanelWithSidebarImpl(id)
}
PanelWithSidebarImpl.prototype = {
- createSidebarPane: function(title, url, callback)
+ createSidebarPane: function(title, callback)
{
var id = "extension-sidebar-" + extensionServer.nextObjectId();
var request = {
command: "createSidebarPane",
panel: this._id,
id: id,
- title: title,
- url: expandURL(url)
- };
- function callbackWrapper()
- {
- callback(new ExtensionSidebarPane(id));
- }
- extensionServer.sendRequest(request, callback && callbackWrapper);
- },
-
- createWatchExpressionSidebarPane: function(title, callback)
- {
- var id = "watch-sidebar-" + extensionServer.nextObjectId();
- var request = {
- command: "createWatchExpressionSidebarPane",
- panel: this._id,
- id: id,
title: title
};
function callbackWrapper()
{
- callback(new WatchExpressionSidebarPane(id));
+ callback(new ExtensionSidebarPane(id));
}
extensionServer.sendRequest(request, callback && callbackWrapper);
}
@@ -242,39 +228,29 @@ function ExtensionPanel(id)
function ExtensionSidebarPaneImpl(id)
{
this._id = id;
+ this.onUpdated = new EventSink("sidebar-updated-" + id);
}
ExtensionSidebarPaneImpl.prototype = {
setHeight: function(height)
{
extensionServer.sendRequest({ command: "setSidebarHeight", id: this._id, height: height });
- }
-}
-
-function WatchExpressionSidebarPaneImpl(id)
-{
- ExtensionSidebarPaneImpl.call(this, id);
- this.onUpdated = new EventSink("watch-sidebar-updated-" + id);
-}
+ },
-WatchExpressionSidebarPaneImpl.prototype = {
setExpression: function(expression, rootTitle)
{
- extensionServer.sendRequest({ command: "setWatchSidebarContent", id: this._id, expression: expression, rootTitle: rootTitle, evaluateOnPage: true });
+ extensionServer.sendRequest({ command: "setSidebarContent", id: this._id, expression: expression, rootTitle: rootTitle, evaluateOnPage: true });
},
setObject: function(jsonObject, rootTitle)
{
- extensionServer.sendRequest({ command: "setWatchSidebarContent", id: this._id, expression: jsonObject, rootTitle: rootTitle });
- }
-}
-
-WatchExpressionSidebarPaneImpl.prototype.__proto__ = ExtensionSidebarPaneImpl.prototype;
+ extensionServer.sendRequest({ command: "setSidebarContent", id: this._id, expression: jsonObject, rootTitle: rootTitle });
+ },
-function WatchExpressionSidebarPane(id)
-{
- var impl = new WatchExpressionSidebarPaneImpl(id);
- ExtensionSidebarPane.call(this, id, impl);
+ setPage: function(url)
+ {
+ extensionServer.sendRequest({ command: "setSidebarPage", id: this._id, url: expandURL(url) });
+ }
}
function Audits()
@@ -381,9 +357,6 @@ AuditResultNode.prototype = {
function InspectedWindow()
{
- this.onDOMContentLoaded = new EventSink("inspectedPageDOMContentLoaded");
- this.onLoaded = new EventSink("inspectedPageLoaded");
- this.onNavigated = new EventSink("inspectedURLChanged");
}
InspectedWindow.prototype = {
@@ -511,7 +484,6 @@ var ExtensionSidebarPane = declareInterfaceClass(ExtensionSidebarPaneImpl);
var Panel = declareInterfaceClass(PanelImpl);
var PanelWithSidebar = declareInterfaceClass(PanelWithSidebarImpl);
var Resource = declareInterfaceClass(ResourceImpl);
-var WatchExpressionSidebarPane = declareInterfaceClass(WatchExpressionSidebarPaneImpl);
var extensionServer = new ExtensionServerClient();