OLD | NEW |
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 Loading... |
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 = cr.icon.getProfileAvatarIcon( | 66 iconElement.style.content = cr.icon.getImage(supervisedUser.iconURL); |
67 supervisedUser.iconURL); | |
68 this.appendChild(iconElement); | 67 this.appendChild(iconElement); |
69 | 68 |
70 // Add the profile name. | 69 // Add the profile name. |
71 var nameElement = this.ownerDocument.createElement('div'); | 70 var nameElement = this.ownerDocument.createElement('div'); |
72 nameElement.className = 'profile-name'; | 71 nameElement.className = 'profile-name'; |
73 nameElement.textContent = supervisedUser.name; | 72 nameElement.textContent = supervisedUser.name; |
74 this.appendChild(nameElement); | 73 this.appendChild(nameElement); |
75 | 74 |
76 if (supervisedUser.onCurrentDevice) { | 75 if (supervisedUser.onCurrentDevice) { |
77 iconElement.className += ' profile-img-disabled'; | 76 iconElement.className += ' profile-img-disabled'; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 this.selectionModel = new ListSingleSelectionModel(); | 111 this.selectionModel = new ListSingleSelectionModel(); |
113 this.autoExpands = true; | 112 this.autoExpands = true; |
114 }, | 113 }, |
115 }; | 114 }; |
116 | 115 |
117 return { | 116 return { |
118 SupervisedUserListItem: SupervisedUserListItem, | 117 SupervisedUserListItem: SupervisedUserListItem, |
119 SupervisedUserList: SupervisedUserList, | 118 SupervisedUserList: SupervisedUserList, |
120 }; | 119 }; |
121 }); | 120 }); |
OLD | NEW |