/**
* Creates a new profile list item.
- * @param {Object} profileInfo The profile this item respresents.
+ * @param {Object} profileInfo The profile this item represents.
* @constructor
- * @extends {cr.ui.DeletableItem}
+ * @extends {options.DeletableItem}
*/
function ProfileListItem(profileInfo) {
var el = cr.doc.createElement('div');
return this.profileInfo_.filePath;
},
- /**
- * @type {boolean} whether this profile is managed.
- */
- get isManaged() {
- return this.profileInfo_.isManaged;
- },
-
/** @override */
decorate: function() {
DeletableItem.prototype.decorate.call(this);
var profileInfo = this.profileInfo_;
+ var containerEl = this.ownerDocument.createElement('div');
+ containerEl.className = 'profile-container';
+
var iconEl = this.ownerDocument.createElement('img');
iconEl.className = 'profile-img';
- iconEl.style.content = imageset(profileInfo.iconURL + '@scalefactorx');
- this.contentElement.appendChild(iconEl);
+ iconEl.style.content = getProfileAvatarIcon(profileInfo.iconURL);
+ containerEl.appendChild(iconEl);
var nameEl = this.ownerDocument.createElement('div');
nameEl.className = 'profile-name';
if (profileInfo.isCurrentProfile)
nameEl.classList.add('profile-item-current');
- this.contentElement.appendChild(nameEl);
+ containerEl.appendChild(nameEl);
var displayName = profileInfo.name;
if (profileInfo.isCurrentProfile) {
}
nameEl.textContent = displayName;
+ if (profileInfo.isSupervised) {
+ var supervisedEl = this.ownerDocument.createElement('div');
+ supervisedEl.className = 'profile-supervised';
+ supervisedEl.textContent =
+ loadTimeData.getString('supervisedUserLabel');
+ containerEl.appendChild(supervisedEl);
+ }
+
+ this.contentElement.appendChild(containerEl);
+
// Ensure that the button cannot be tabbed to for accessibility reasons.
this.closeButtonElement.tabIndex = -1;
},
/** @override */
deleteItemAtIndex: function(index) {
- if (loadTimeData.getBoolean('profileIsManaged'))
+ if (loadTimeData.getBoolean('profileIsSupervised'))
return;
ManageProfileOverlay.showDeleteDialog(this.dataModel.item(index));
},
},
/**
- * If false, items in this list will not be deltable.
+ * If false, items in this list will not be deletable.
* @private
*/
canDeleteItems_: true,
ProfileList: ProfileList
};
});
-