| 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 = 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 Loading... |
| 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 }); |
| OLD | NEW |