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

Side by Side Diff: chrome/browser/resources/sync_file_system_internals/utils.js

Issue 917093003: Shorten Closure template notation from Array.<*> to Array<*>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove cvox Created 5 years, 10 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 * Creates an element named |elementName| containing the content |text|. 6 * Creates an element named |elementName| containing the content |text|.
7 * @param {string} elementName Name of the new element to be created. 7 * @param {string} elementName Name of the new element to be created.
8 * @param {string} text Text to be contained in the new element. 8 * @param {string} text Text to be contained in the new element.
9 * @param {Object} opt_attributes Optional attribute dictionary for the element. 9 * @param {Object} opt_attributes Optional attribute dictionary for the element.
10 * @return {HTMLElement} The newly created HTML element. 10 * @return {HTMLElement} The newly created HTML element.
11 */ 11 */
12 function createElementFromText(elementName, text, opt_attributes) { 12 function createElementFromText(elementName, text, opt_attributes) {
13 var element = document.createElement(elementName); 13 var element = document.createElement(elementName);
14 element.appendChild(document.createTextNode(text)); 14 element.appendChild(document.createTextNode(text));
15 if (opt_attributes) { 15 if (opt_attributes) {
16 for (var key in opt_attributes) 16 for (var key in opt_attributes)
17 element.setAttribute(key, opt_attributes[key]); 17 element.setAttribute(key, opt_attributes[key]);
18 } 18 }
19 return element; 19 return element;
20 } 20 }
21 21
22 /** 22 /**
23 * Creates an element with |tagName| containing the content |dict|. 23 * Creates an element with |tagName| containing the content |dict|.
24 * @param {string} elementName Name of the new element to be created. 24 * @param {string} elementName Name of the new element to be created.
25 * @param {Object.<string, string>} dict Dictionary to be contained in the new 25 * @param {Object<string, string>} dict Dictionary to be contained in the new
26 * element. 26 * element.
27 * @return {HTMLElement} The newly created HTML element. 27 * @return {HTMLElement} The newly created HTML element.
28 */ 28 */
29 function createElementFromDictionary(elementName, dict) { 29 function createElementFromDictionary(elementName, dict) {
30 var element = document.createElement(elementName); 30 var element = document.createElement(elementName);
31 for (var key in dict) { 31 for (var key in dict) {
32 element.appendChild(document.createTextNode(key + ': ' + dict[key])); 32 element.appendChild(document.createTextNode(key + ': ' + dict[key]));
33 element.appendChild(document.createElement('br')); 33 element.appendChild(document.createElement('br'));
34 } 34 }
35 return element; 35 return element;
36 } 36 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698