OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 WebInspector.ExtensionAuditFormatters = { | 174 WebInspector.ExtensionAuditFormatters = { |
175 /** | 175 /** |
176 * @this {WebInspector.ExtensionAuditCategoryResults} | 176 * @this {WebInspector.ExtensionAuditCategoryResults} |
177 * @param {string} expression | 177 * @param {string} expression |
178 * @param {string} title | 178 * @param {string} title |
179 * @param {?Object} evaluateOptions | 179 * @param {?Object} evaluateOptions |
180 * @return {!Element} | 180 * @return {!Element} |
181 */ | 181 */ |
182 object: function(expression, title, evaluateOptions) | 182 object: function(expression, title, evaluateOptions) |
183 { | 183 { |
184 var parentElement = document.createElement("div"); | 184 var parentElement = createElement("div"); |
185 function onEvaluate(remoteObject) | 185 function onEvaluate(remoteObject) |
186 { | 186 { |
187 var section = new WebInspector.ObjectPropertiesSection(remoteObject,
title); | 187 var section = new WebInspector.ObjectPropertiesSection(remoteObject,
title); |
188 section.expanded = true; | 188 section.expanded = true; |
189 section.editable = false; | 189 section.editable = false; |
190 parentElement.appendChild(section.element); | 190 parentElement.appendChild(section.element); |
191 } | 191 } |
192 this.evaluate(expression, evaluateOptions, onEvaluate); | 192 this.evaluate(expression, evaluateOptions, onEvaluate); |
193 return parentElement; | 193 return parentElement; |
194 }, | 194 }, |
195 | 195 |
196 /** | 196 /** |
197 * @this {WebInspector.ExtensionAuditCategoryResults} | 197 * @this {WebInspector.ExtensionAuditCategoryResults} |
198 * @param {string} expression | 198 * @param {string} expression |
199 * @param {?Object} evaluateOptions | 199 * @param {?Object} evaluateOptions |
200 * @return {!Element} | 200 * @return {!Element} |
201 */ | 201 */ |
202 node: function(expression, evaluateOptions) | 202 node: function(expression, evaluateOptions) |
203 { | 203 { |
204 var parentElement = document.createElement("div"); | 204 var parentElement = createElement("div"); |
205 this.evaluate(expression, evaluateOptions, onEvaluate); | 205 this.evaluate(expression, evaluateOptions, onEvaluate); |
206 | 206 |
207 /** | 207 /** |
208 * @param {!WebInspector.RemoteObject} remoteObject | 208 * @param {!WebInspector.RemoteObject} remoteObject |
209 */ | 209 */ |
210 function onEvaluate(remoteObject) | 210 function onEvaluate(remoteObject) |
211 { | 211 { |
212 WebInspector.Renderer.renderPromise(remoteObject).then(appendRendere
r).thenOrCatch(remoteObject.release.bind(remoteObject)).done(); | 212 WebInspector.Renderer.renderPromise(remoteObject).then(appendRendere
r).thenOrCatch(remoteObject.release.bind(remoteObject)).done(); |
213 | 213 |
214 /** | 214 /** |
215 * @param {!Element} element | 215 * @param {!Element} element |
216 */ | 216 */ |
217 function appendRenderer(element) | 217 function appendRenderer(element) |
218 { | 218 { |
219 parentElement.appendChild(element); | 219 parentElement.appendChild(element); |
220 } | 220 } |
221 } | 221 } |
222 return parentElement; | 222 return parentElement; |
223 } | 223 } |
224 } | 224 } |
225 | 225 |
226 WebInspector.ExtensionAuditCategoryResults._lastId = 0; | 226 WebInspector.ExtensionAuditCategoryResults._lastId = 0; |
OLD | NEW |