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

Side by Side Diff: chrome/browser/resources/options2/certificate_tree.js

Issue 10391044: retry 136193 - convert localStrings to loadTimeData for options page (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 8 years, 7 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 // 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 cr.define('options', function() { 5 cr.define('options', function() {
6 /** @const */ var Tree = cr.ui.Tree; 6 /** @const */ var Tree = cr.ui.Tree;
7 /** @const */ var TreeItem = cr.ui.TreeItem; 7 /** @const */ var TreeItem = cr.ui.TreeItem;
8 8
9 /** 9 /**
10 * Creates a new tree item for certificate data. 10 * Creates a new tree item for certificate data.
11 * @param {Object=} data Data used to create a certificate tree item. 11 * @param {Object=} data Data used to create a certificate tree item.
12 * @constructor 12 * @constructor
13 * @extends {TreeItem} 13 * @extends {TreeItem}
14 */ 14 */
15 function CertificateTreeItem(data) { 15 function CertificateTreeItem(data) {
16 // TODO(mattm): other columns 16 // TODO(mattm): other columns
17 var treeItem = new TreeItem({ 17 var treeItem = new TreeItem({
18 label: data.name, 18 label: data.name,
19 data: data 19 data: data
20 }); 20 });
21 treeItem.__proto__ = CertificateTreeItem.prototype; 21 treeItem.__proto__ = CertificateTreeItem.prototype;
22 22
23 if (data.icon) { 23 if (data.icon) {
24 treeItem.icon = data.icon; 24 treeItem.icon = data.icon;
25 } 25 }
26 26
27 if (data.untrusted) { 27 if (data.untrusted) {
28 var badge = document.createElement('span'); 28 var badge = document.createElement('span');
29 badge.classList.add('cert-untrusted'); 29 badge.classList.add('cert-untrusted');
30 badge.textContent = localStrings.getString('badgeCertUntrusted'); 30 badge.textContent = loadTimeData.getString('badgeCertUntrusted');
31 treeItem.labelElement.insertBefore( 31 treeItem.labelElement.insertBefore(
32 badge, treeItem.labelElement.firstChild); 32 badge, treeItem.labelElement.firstChild);
33 } 33 }
34 34
35 return treeItem; 35 return treeItem;
36 } 36 }
37 37
38 CertificateTreeItem.prototype = { 38 CertificateTreeItem.prototype = {
39 __proto__: TreeItem.prototype, 39 __proto__: TreeItem.prototype,
40 40
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 118
119 cr.dispatchSimpleEvent(this, 'change'); 119 cr.dispatchSimpleEvent(this, 'change');
120 }, 120 },
121 }; 121 };
122 122
123 return { 123 return {
124 CertificatesTree: CertificatesTree 124 CertificatesTree: CertificatesTree
125 }; 125 };
126 }); 126 });
127 127
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698