summaryrefslogtreecommitdiffstats
path: root/webkit/glue/devtools/js
diff options
context:
space:
mode:
authorpfeldman@chromium.org <pfeldman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-07 09:21:32 +0000
committerpfeldman@chromium.org <pfeldman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-07 09:21:32 +0000
commitd6ee9e14d95013491f7f997644ff1daa80f0cbd7 (patch)
tree5c513ac7ae14b5291b2efdd9da2b46396a554671 /webkit/glue/devtools/js
parent7844fc5edc61e4e90509f90bf0ee0cb110889ca9 (diff)
downloadchromium_src-d6ee9e14d95013491f7f997644ff1daa80f0cbd7.zip
chromium_src-d6ee9e14d95013491f7f997644ff1daa80f0cbd7.tar.gz
chromium_src-d6ee9e14d95013491f7f997644ff1daa80f0cbd7.tar.bz2
DevTools: add basic console support.
Review URL: http://codereview.chromium.org/62050 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13240 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/devtools/js')
-rw-r--r--webkit/glue/devtools/js/devtools.js88
-rw-r--r--webkit/glue/devtools/js/devtools_host_stub.js5
-rw-r--r--webkit/glue/devtools/js/inspector_controller_impl.js8
3 files changed, 66 insertions, 35 deletions
diff --git a/webkit/glue/devtools/js/devtools.js b/webkit/glue/devtools/js/devtools.js
index b3b6266..4454213 100644
--- a/webkit/glue/devtools/js/devtools.js
+++ b/webkit/glue/devtools/js/devtools.js
@@ -21,6 +21,8 @@ devtools.ToolsAgent = function() {
goog.bind(this.updateFocusedNode, this);
RemoteToolsAgent.FrameNavigate =
goog.bind(this.frameNavigate, this);
+ RemoteToolsAgent.AddMessageToConsole =
+ goog.bind(this.addMessageToConsole, this);
this.debuggerAgent_ = new devtools.DebuggerAgent();
this.domAgent_ = new devtools.DomAgent();
this.netAgent_ = new devtools.NetAgent();
@@ -130,6 +132,22 @@ devtools.ToolsAgent.prototype.frameNavigate = function(url, topLevel) {
/**
+ * @param {string} message Message to add.
+ * @param {string} source Source url.
+ * @param {number} line Line number in source.
+ * @see tools_agent.h
+ */
+devtools.ToolsAgent.prototype.addMessageToConsole = function(message, source,
+ line) {
+ var console = WebInspector.console;
+ if (console) {
+ console.addMessage(new WebInspector.ConsoleMessage(
+ "", undefined, line, source, undefined, 1, message));
+ }
+};
+
+
+/**
* Evaluates js expression.
* @param {string} expr
*/
@@ -451,38 +469,38 @@ WebInspector.didGetNodePropertiesAsync_ = function(treeOutline, constructor,
* representation. Original method uses Object.prototype.toString.call to
* learn if scope object is a JSActivation which doesn't work in Chrome.
*/
-WebInspector.ScopeChainSidebarPane.prototype.update = function(callFrame) {
- this.bodyElement.removeChildren();
-
- this.sections = [];
- this.callFrame = callFrame;
-
- if (!callFrame) {
- var infoElement = document.createElement("div");
- infoElement.className = "info";
- infoElement.textContent = WebInspector.UIString("Not Paused");
- this.bodyElement.appendChild(infoElement);
- return;
- }
-
- if (!callFrame._expandedProperties) {
- callFrame._expandedProperties = {};
- }
-
- var scopeObject = callFrame.localScope;
- var title = WebInspector.UIString("Local");
- var subtitle = Object.describe(scopeObject, true);
- var emptyPlaceholder = null;
- var extraProperties = null;
-
- var section = new WebInspector.ObjectPropertiesSection(scopeObject, title,
- subtitle, emptyPlaceholder, true, extraProperties,
- WebInspector.ScopeVariableTreeElement);
- section.editInSelectedCallFrameWhenPaused = true;
- section.pane = this;
-
- section.expanded = true;
-
- this.sections.push(section);
- this.bodyElement.appendChild(section.element);
-};
+WebInspector.ScopeChainSidebarPane.prototype.update = function(callFrame) {
+ this.bodyElement.removeChildren();
+
+ this.sections = [];
+ this.callFrame = callFrame;
+
+ if (!callFrame) {
+ var infoElement = document.createElement("div");
+ infoElement.className = "info";
+ infoElement.textContent = WebInspector.UIString("Not Paused");
+ this.bodyElement.appendChild(infoElement);
+ return;
+ }
+
+ if (!callFrame._expandedProperties) {
+ callFrame._expandedProperties = {};
+ }
+
+ var scopeObject = callFrame.localScope;
+ var title = WebInspector.UIString("Local");
+ var subtitle = Object.describe(scopeObject, true);
+ var emptyPlaceholder = null;
+ var extraProperties = null;
+
+ var section = new WebInspector.ObjectPropertiesSection(scopeObject, title,
+ subtitle, emptyPlaceholder, true, extraProperties,
+ WebInspector.ScopeVariableTreeElement);
+ section.editInSelectedCallFrameWhenPaused = true;
+ section.pane = this;
+
+ section.expanded = true;
+
+ this.sections.push(section);
+ this.bodyElement.appendChild(section.element);
+};
diff --git a/webkit/glue/devtools/js/devtools_host_stub.js b/webkit/glue/devtools/js/devtools_host_stub.js
index 6bc9690..fd398bc 100644
--- a/webkit/glue/devtools/js/devtools_host_stub.js
+++ b/webkit/glue/devtools/js/devtools_host_stub.js
@@ -202,6 +202,10 @@ RemoteToolsAgentStub.prototype.GetNodePrototypes = function(callId, nodeId) {
};
+RemoteToolsAgentStub.prototype.ClearConsoleMessages = function() {
+};
+
+
/**
* @constructor
*/
@@ -232,6 +236,7 @@ DevToolsHostStub.prototype.loaded = function() {
RemoteDomAgentStub.sendChildNodes_(1);
RemoteDomAgentStub.sendChildNodes_(2);
devtools.tools.updateFocusedNode(4);
+ devtools.tools.addMessageToConsole('message', 'source', 3);
};
diff --git a/webkit/glue/devtools/js/inspector_controller_impl.js b/webkit/glue/devtools/js/inspector_controller_impl.js
index 2e88115..e6fa74d 100644
--- a/webkit/glue/devtools/js/inspector_controller_impl.js
+++ b/webkit/glue/devtools/js/inspector_controller_impl.js
@@ -20,6 +20,14 @@ goog.inherits(devtools.InspectorControllerImpl,
/**
* {@inheritDoc}.
*/
+devtools.InspectorController.prototype.clearMessages = function() {
+ RemoteToolsAgent.ClearConsoleMessages();
+};
+
+
+/**
+ * {@inheritDoc}.
+ */
devtools.InspectorControllerImpl.prototype.hiddenPanels = function() {
return "profiles,databases";
};