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

Side by Side Diff: ui/webui/resources/js/util.js

Issue 2470063003: Move importModules function to util.js (Closed)
Patch Set: Add suppress Created 4 years, 1 month 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
« no previous file with comments | « chrome/test/data/webui/plugins_browsertest.js ('k') | no next file » | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // <include src="assert.js"> 5 // <include src="assert.js">
6 6
7 /** 7 /**
8 * Alias for document.getElementById. Found elements must be HTMLElements. 8 * Alias for document.getElementById. Found elements must be HTMLElements.
9 * @param {string} id The ID of the element to find. 9 * @param {string} id The ID of the element to find.
10 * @return {HTMLElement} The found element or null if not found. 10 * @return {HTMLElement} The found element or null if not found.
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after
479 case 0xdb: return '['; 479 case 0xdb: return '[';
480 case 0xdd: return ']'; 480 case 0xdd: return ']';
481 } 481 }
482 return 'Unidentified'; 482 return 'Unidentified';
483 } 483 }
484 }); 484 });
485 } else { 485 } else {
486 window.console.log("KeyboardEvent.Key polyfill not required"); 486 window.console.log("KeyboardEvent.Key polyfill not required");
487 } 487 }
488 // </if> /* is_ios */ 488 // </if> /* is_ios */
489
490 /**
491 * Helper to convert callback-based define() API to a promise-based API.
492 * @suppress {undefinedVars}
493 * @param {!Array<string>} moduleNames
494 * @return {!Promise}
495 */
496 function importModules(moduleNames) {
497 return new Promise(function(resolve) {
498 define(moduleNames, function() {
499 resolve(Array.from(arguments));
500 });
501 });
502 }
OLDNEW
« no previous file with comments | « chrome/test/data/webui/plugins_browsertest.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698