Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(560)

Side by Side Diff: webkit/glue/devtools/js/devtools.js

Issue 62050: DevTools: add basic console support. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « webkit/glue/chrome_client_impl.cc ('k') | webkit/glue/devtools/js/devtools_host_stub.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @fileoverview Tools is a main class that wires all components of the 6 * @fileoverview Tools is a main class that wires all components of the
7 * DevTools frontend together. It is also responsible for overriding existing 7 * DevTools frontend together. It is also responsible for overriding existing
8 * WebInspector functionality while it is getting upstreamed into WebCore. 8 * WebInspector functionality while it is getting upstreamed into WebCore.
9 */ 9 */
10 goog.provide('devtools.Tools'); 10 goog.provide('devtools.Tools');
11 11
12 goog.require('devtools.DebuggerAgent'); 12 goog.require('devtools.DebuggerAgent');
13 goog.require('devtools.DomAgent'); 13 goog.require('devtools.DomAgent');
14 goog.require('devtools.NetAgent'); 14 goog.require('devtools.NetAgent');
15 15
16 devtools.ToolsAgent = function() { 16 devtools.ToolsAgent = function() {
17 RemoteToolsAgent.DidEvaluateJavaScript = devtools.Callback.processCallback; 17 RemoteToolsAgent.DidEvaluateJavaScript = devtools.Callback.processCallback;
18 RemoteToolsAgent.DidExecuteUtilityFunction = 18 RemoteToolsAgent.DidExecuteUtilityFunction =
19 devtools.Callback.processCallback; 19 devtools.Callback.processCallback;
20 RemoteToolsAgent.UpdateFocusedNode = 20 RemoteToolsAgent.UpdateFocusedNode =
21 goog.bind(this.updateFocusedNode, this); 21 goog.bind(this.updateFocusedNode, this);
22 RemoteToolsAgent.FrameNavigate = 22 RemoteToolsAgent.FrameNavigate =
23 goog.bind(this.frameNavigate, this); 23 goog.bind(this.frameNavigate, this);
24 RemoteToolsAgent.AddMessageToConsole =
25 goog.bind(this.addMessageToConsole, this);
24 this.debuggerAgent_ = new devtools.DebuggerAgent(); 26 this.debuggerAgent_ = new devtools.DebuggerAgent();
25 this.domAgent_ = new devtools.DomAgent(); 27 this.domAgent_ = new devtools.DomAgent();
26 this.netAgent_ = new devtools.NetAgent(); 28 this.netAgent_ = new devtools.NetAgent();
27 }; 29 };
28 30
29 31
30 /** 32 /**
31 * Resets tools agent to its initial state. 33 * Resets tools agent to its initial state.
32 */ 34 */
33 devtools.ToolsAgent.prototype.reset = function() { 35 devtools.ToolsAgent.prototype.reset = function() {
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 */ 125 */
124 devtools.ToolsAgent.prototype.frameNavigate = function(url, topLevel) { 126 devtools.ToolsAgent.prototype.frameNavigate = function(url, topLevel) {
125 if (topLevel) { 127 if (topLevel) {
126 this.reset(); 128 this.reset();
127 WebInspector.reset(); 129 WebInspector.reset();
128 } 130 }
129 }; 131 };
130 132
131 133
132 /** 134 /**
135 * @param {string} message Message to add.
136 * @param {string} source Source url.
137 * @param {number} line Line number in source.
138 * @see tools_agent.h
139 */
140 devtools.ToolsAgent.prototype.addMessageToConsole = function(message, source,
141 line) {
142 var console = WebInspector.console;
143 if (console) {
144 console.addMessage(new WebInspector.ConsoleMessage(
145 "", undefined, line, source, undefined, 1, message));
146 }
147 };
148
149
150 /**
133 * Evaluates js expression. 151 * Evaluates js expression.
134 * @param {string} expr 152 * @param {string} expr
135 */ 153 */
136 devtools.ToolsAgent.prototype.evaluate = function(expr) { 154 devtools.ToolsAgent.prototype.evaluate = function(expr) {
137 RemoteToolsAgent.evaluate(expr); 155 RemoteToolsAgent.evaluate(expr);
138 }; 156 };
139 157
140 158
141 /** 159 /**
142 * Prints string to the inspector console or shows alert if the console doesn't 160 * Prints string to the inspector console or shows alert if the console doesn't
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
479 subtitle, emptyPlaceholder, true, extraProperties, 497 subtitle, emptyPlaceholder, true, extraProperties,
480 WebInspector.ScopeVariableTreeElement); 498 WebInspector.ScopeVariableTreeElement);
481 section.editInSelectedCallFrameWhenPaused = true; 499 section.editInSelectedCallFrameWhenPaused = true;
482 section.pane = this; 500 section.pane = this;
483 501
484 section.expanded = true; 502 section.expanded = true;
485 503
486 this.sections.push(section); 504 this.sections.push(section);
487 this.bodyElement.appendChild(section.element); 505 this.bodyElement.appendChild(section.element);
488 }; 506 };
OLDNEW
« no previous file with comments | « webkit/glue/chrome_client_impl.cc ('k') | webkit/glue/devtools/js/devtools_host_stub.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698