| OLD | NEW |
| 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'); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 this.netAgent_ = new devtools.NetAgent(); | 26 this.netAgent_ = new devtools.NetAgent(); |
| 27 this.reset(); | 27 this.reset(); |
| 28 }; | 28 }; |
| 29 | 29 |
| 30 | 30 |
| 31 /** | 31 /** |
| 32 * Rests tools agent to its initial state. | 32 * Rests tools agent to its initial state. |
| 33 */ | 33 */ |
| 34 devtools.ToolsAgent.prototype.reset = function() { | 34 devtools.ToolsAgent.prototype.reset = function() { |
| 35 this.domAgent_.reset(); | 35 this.domAgent_.reset(); |
| 36 this.netAgent_.reset(); |
| 36 this.domAgent_.getDocumentElementAsync(); | 37 this.domAgent_.getDocumentElementAsync(); |
| 37 }; | 38 }; |
| 38 | 39 |
| 39 | 40 |
| 40 /** | 41 /** |
| 41 * @param {string} script Script exression to be evaluated in the context of the | 42 * @param {string} script Script exression to be evaluated in the context of the |
| 42 * inspected page. | 43 * inspected page. |
| 43 * @param {function(string):undefined} callback Function to call with the | 44 * @param {function(string):undefined} callback Function to call with the |
| 44 * result. | 45 * result. |
| 45 */ | 46 */ |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 /** | 108 /** |
| 108 * @see tools_agent.h | 109 * @see tools_agent.h |
| 109 */ | 110 */ |
| 110 devtools.ToolsAgent.prototype.updateFocusedNode = function(nodeId) { | 111 devtools.ToolsAgent.prototype.updateFocusedNode = function(nodeId) { |
| 111 var node = this.domAgent_.getNodeForId(nodeId); | 112 var node = this.domAgent_.getNodeForId(nodeId); |
| 112 WebInspector.updateFocusedNode(node); | 113 WebInspector.updateFocusedNode(node); |
| 113 }; | 114 }; |
| 114 | 115 |
| 115 | 116 |
| 116 /** | 117 /** |
| 118 * @param {string} url Url frame navigated to. |
| 119 * @param {bool} topLevel True iff top level navigation occurred. |
| 117 * @see tools_agent.h | 120 * @see tools_agent.h |
| 118 */ | 121 */ |
| 119 devtools.ToolsAgent.prototype.frameNavigate = function(url, topLevel) { | 122 devtools.ToolsAgent.prototype.frameNavigate = function(url, topLevel) { |
| 120 this.reset(); | 123 if (topLevel) { |
| 121 WebInspector.reset(); | 124 this.reset(); |
| 125 WebInspector.reset(); |
| 126 } |
| 122 }; | 127 }; |
| 123 | 128 |
| 124 | 129 |
| 125 /** | 130 /** |
| 126 * Evaluates js expression. | 131 * Evaluates js expression. |
| 127 * @param {string} expr | 132 * @param {string} expr |
| 128 */ | 133 */ |
| 129 devtools.ToolsAgent.prototype.evaluate = function(expr) { | 134 devtools.ToolsAgent.prototype.evaluate = function(expr) { |
| 130 RemoteToolsAgent.evaluate(expr); | 135 RemoteToolsAgent.evaluate(expr); |
| 131 }; | 136 }; |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 } | 317 } |
| 313 properties.sort(); | 318 properties.sort(); |
| 314 | 319 |
| 315 treeOutline.removeChildren(); | 320 treeOutline.removeChildren(); |
| 316 | 321 |
| 317 for (var i = 0; i < properties.length; ++i) { | 322 for (var i = 0; i < properties.length; ++i) { |
| 318 var propertyName = properties[i]; | 323 var propertyName = properties[i]; |
| 319 treeOutline.appendChild(new constructor(obj, propertyName)); | 324 treeOutline.appendChild(new constructor(obj, propertyName)); |
| 320 } | 325 } |
| 321 }; | 326 }; |
| OLD | NEW |