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

Side by Side Diff: Source/devtools/front_end/extensions/ExtensionAuditCategory.js

Issue 662793002: [DevTools] Replace usages of document with custom functions. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 2 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
OLDNEW
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
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;
OLDNEW
« no previous file with comments | « Source/devtools/front_end/elements/StylesSidebarPane.js ('k') | Source/devtools/front_end/extensions/ExtensionPanel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698