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 These stubs emulate backend functionality and allows | 6 * @fileoverview These stubs emulate backend functionality and allows |
7 * DevTools frontend to function as a standalone web app. | 7 * DevTools frontend to function as a standalone web app. |
8 */ | 8 */ |
9 | 9 |
10 /** | 10 /** |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 }; | 88 }; |
89 | 89 |
90 | 90 |
91 RemoteDomAgentStub.prototype.PerformSearch = function(callId, query) { | 91 RemoteDomAgentStub.prototype.PerformSearch = function(callId, query) { |
92 setTimeout(function() { | 92 setTimeout(function() { |
93 RemoteDomAgent.DidPerformSearch(callId, [1]); | 93 RemoteDomAgent.DidPerformSearch(callId, [1]); |
94 }, 0); | 94 }, 0); |
95 }; | 95 }; |
96 | 96 |
97 | 97 |
| 98 RemoteDomAgentStub.prototype.DiscardBindings = function() { |
| 99 }; |
| 100 |
| 101 |
98 /** | 102 /** |
99 * @constructor | 103 * @constructor |
100 */ | 104 */ |
101 RemoteToolsAgentStub = function() { | 105 RemoteToolsAgentStub = function() { |
102 }; | 106 }; |
103 | 107 |
104 | 108 |
105 RemoteToolsAgentStub.prototype.HideDOMNodeHighlight = function() { | 109 RemoteToolsAgentStub.prototype.HideDOMNodeHighlight = function() { |
106 }; | 110 }; |
107 | 111 |
108 | 112 |
109 RemoteToolsAgentStub.prototype.HighlightDOMNode = function() { | 113 RemoteToolsAgentStub.prototype.HighlightDOMNode = function() { |
110 }; | 114 }; |
111 | 115 |
112 | 116 |
113 RemoteToolsAgentStub.prototype.SetDomAgentEnabled = function() { | 117 RemoteToolsAgentStub.prototype.SetEnabled = function() { |
114 }; | 118 }; |
115 | 119 |
116 | 120 |
117 RemoteToolsAgentStub.prototype.SetNetAgentEnabled = function() { | 121 RemoteToolsAgentStub.prototype.evaluate = function(expr) { |
| 122 window.eval(expr); |
118 }; | 123 }; |
119 | 124 |
120 | 125 |
121 /** | 126 /** |
122 * @constructor | 127 * @constructor |
123 */ | 128 */ |
124 RemoteNetAgentStub = function() { | 129 RemoteNetAgentStub = function() { |
125 }; | 130 }; |
126 | 131 |
127 | 132 |
128 /** | 133 /** |
129 * @constructor | 134 * @constructor |
130 */ | 135 */ |
131 DevToolsHostStub = function() { | 136 DevToolsHostStub = function() { |
132 }; | 137 }; |
133 | 138 |
134 | 139 |
135 DevToolsHostStub.prototype.loaded = function() { | 140 DevToolsHostStub.prototype.loaded = function() { |
136 RemoteDomAgentStub.sendDocumentElement_(); | 141 RemoteDomAgentStub.sendDocumentElement_(); |
137 RemoteDomAgentStub.sendChildNodes_(1); | 142 RemoteDomAgentStub.sendChildNodes_(1); |
138 RemoteDomAgentStub.sendChildNodes_(2); | 143 RemoteDomAgentStub.sendChildNodes_(2); |
139 toolsAgent.updateFocusedNode(4); | 144 devtools.tools.updateFocusedNode(4); |
140 }; | 145 }; |
141 | 146 |
142 | 147 |
143 if (!window['DevToolsHost']) { | 148 if (!window['DevToolsHost']) { |
144 window['RemoteDomAgent'] = new RemoteDomAgentStub(); | 149 window['RemoteDomAgent'] = new RemoteDomAgentStub(); |
145 window['RemoteNetAgent'] = new RemoteNetAgentStub(); | 150 window['RemoteNetAgent'] = new RemoteNetAgentStub(); |
146 window['RemoteToolsAgent'] = new RemoteToolsAgentStub(); | 151 window['RemoteToolsAgent'] = new RemoteToolsAgentStub(); |
147 window['DevToolsHost'] = new DevToolsHostStub(); | 152 window['DevToolsHost'] = new DevToolsHostStub(); |
148 } | 153 } |
OLD | NEW |