Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / resources / options / browser_options_profile_list.js
index 7a60ca3..87542ae 100644 (file)
@@ -9,9 +9,9 @@ cr.define('options.browser_options', function() {
 
   /**
    * 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');
@@ -39,29 +39,25 @@ cr.define('options.browser_options', function() {
       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) {
@@ -70,6 +66,16 @@ cr.define('options.browser_options', function() {
       }
       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;
     },
@@ -95,7 +101,7 @@ cr.define('options.browser_options', function() {
 
     /** @override */
     deleteItemAtIndex: function(index) {
-      if (loadTimeData.getBoolean('profileIsManaged'))
+      if (loadTimeData.getBoolean('profileIsSupervised'))
         return;
       ManageProfileOverlay.showDeleteDialog(this.dataModel.item(index));
     },
@@ -116,7 +122,7 @@ cr.define('options.browser_options', function() {
     },
 
     /**
-     * If false, items in this list will not be deltable.
+     * If false, items in this list will not be deletable.
      * @private
      */
     canDeleteItems_: true,
@@ -126,4 +132,3 @@ cr.define('options.browser_options', function() {
     ProfileList: ProfileList
   };
 });
-