summaryrefslogtreecommitdiffstats
path: root/webkit/glue/devtools/js/devtools.js
diff options
context:
space:
mode:
Diffstat (limited to 'webkit/glue/devtools/js/devtools.js')
-rw-r--r--webkit/glue/devtools/js/devtools.js88
1 files changed, 53 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);
+};