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

Side by Side Diff: chrome/browser/resources/options/supervised_user_list.js

Issue 1919183005: Cleanup: Extract icon related methods outside of util.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rename favicon.html to icon.html Created 4 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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.supervisedUserOptions', function() { 5 cr.define('options.supervisedUserOptions', function() {
6 /** @const */ var List = cr.ui.List; 6 /** @const */ var List = cr.ui.List;
7 /** @const */ var ListItem = cr.ui.ListItem; 7 /** @const */ var ListItem = cr.ui.ListItem;
8 /** @const */ var ListSingleSelectionModel = cr.ui.ListSingleSelectionModel; 8 /** @const */ var ListSingleSelectionModel = cr.ui.ListSingleSelectionModel;
9 9
10 /** 10 /**
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 }, 56 },
57 57
58 /** @override */ 58 /** @override */
59 decorate: function() { 59 decorate: function() {
60 ListItem.prototype.decorate.call(this); 60 ListItem.prototype.decorate.call(this);
61 var supervisedUser = this.supervisedUser_; 61 var supervisedUser = this.supervisedUser_;
62 62
63 // Add the avatar. 63 // Add the avatar.
64 var iconElement = this.ownerDocument.createElement('img'); 64 var iconElement = this.ownerDocument.createElement('img');
65 iconElement.className = 'profile-img'; 65 iconElement.className = 'profile-img';
66 iconElement.style.content = getProfileAvatarIcon(supervisedUser.iconURL); 66 iconElement.style.content = cr.icon.getProfileAvatarIcon(
67 supervisedUser.iconURL);
67 this.appendChild(iconElement); 68 this.appendChild(iconElement);
68 69
69 // Add the profile name. 70 // Add the profile name.
70 var nameElement = this.ownerDocument.createElement('div'); 71 var nameElement = this.ownerDocument.createElement('div');
71 nameElement.className = 'profile-name'; 72 nameElement.className = 'profile-name';
72 nameElement.textContent = supervisedUser.name; 73 nameElement.textContent = supervisedUser.name;
73 this.appendChild(nameElement); 74 this.appendChild(nameElement);
74 75
75 if (supervisedUser.onCurrentDevice) { 76 if (supervisedUser.onCurrentDevice) {
76 iconElement.className += ' profile-img-disabled'; 77 iconElement.className += ' profile-img-disabled';
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 this.selectionModel = new ListSingleSelectionModel(); 112 this.selectionModel = new ListSingleSelectionModel();
112 this.autoExpands = true; 113 this.autoExpands = true;
113 }, 114 },
114 }; 115 };
115 116
116 return { 117 return {
117 SupervisedUserListItem: SupervisedUserListItem, 118 SupervisedUserListItem: SupervisedUserListItem,
118 SupervisedUserList: SupervisedUserList, 119 SupervisedUserList: SupervisedUserList,
119 }; 120 };
120 }); 121 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698