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

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

Issue 132013002: Replace own callback handling with Promises. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Change tests to async. Created 6 years, 11 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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.managedUserOptions', function() { 5 cr.define('options.managedUserOptions', 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 iconElement.style.content = 65 iconElement.style.content =
66 imageset(managedUser.iconURL + '@scalefactorx'); 66 imageset(managedUser.iconURL + '@scalefactorx');
67 this.appendChild(iconElement); 67 this.appendChild(iconElement);
68 68
69 // Add the profile name. 69 // Add the profile name.
70 var nameElement = this.ownerDocument.createElement('div'); 70 var nameElement = this.ownerDocument.createElement('div');
71 nameElement.className = 'profile-name'; 71 nameElement.className = 'profile-name';
72 nameElement.textContent = managedUser.name; 72 nameElement.textContent = managedUser.name;
73 this.appendChild(nameElement); 73 this.appendChild(nameElement);
74 74
75 if (managedUser.onCurrentDevice) { 75 if (managedUser.onCurrentDevice || managedUser.nameConflict) {
76 iconElement.className += ' profile-img-disabled'; 76 iconElement.className += ' profile-img-disabled';
77 nameElement.className += ' profile-name-disabled'; 77 nameElement.className += ' profile-name-disabled';
78 78
79 // Add "(already on this device)" message. 79 // Add "(already on this device)" message.
80 var alreadyOnDeviceElement = this.ownerDocument.createElement('div'); 80 var alreadyOnDeviceElement = this.ownerDocument.createElement('div');
81 alreadyOnDeviceElement.className = 81 alreadyOnDeviceElement.className =
82 'profile-name-disabled already-on-this-device'; 82 'profile-name-disabled already-on-this-device';
83 alreadyOnDeviceElement.textContent = 83 alreadyOnDeviceElement.textContent = loadTimeData.getString(
84 loadTimeData.getString('managedUserAlreadyOnThisDevice'); 84 managedUser.onCurrentDevice ? 'managedUserAlreadyOnThisDevice' :
85 'managedUserNameConflict');
85 this.appendChild(alreadyOnDeviceElement); 86 this.appendChild(alreadyOnDeviceElement);
86 } 87 }
87 }, 88 },
88 }; 89 };
89 90
90 /** 91 /**
91 * Create a new managed users list. 92 * Create a new managed users list.
92 * @constructor 93 * @constructor
93 * @extends {cr.ui.List} 94 * @extends {cr.ui.List}
94 */ 95 */
(...skipping 13 matching lines...) Expand all
108 this.selectionModel = new ListSingleSelectionModel(); 109 this.selectionModel = new ListSingleSelectionModel();
109 this.autoExpands = true; 110 this.autoExpands = true;
110 }, 111 },
111 }; 112 };
112 113
113 return { 114 return {
114 ManagedUserListItem: ManagedUserListItem, 115 ManagedUserListItem: ManagedUserListItem,
115 ManagedUserList: ManagedUserList, 116 ManagedUserList: ManagedUserList,
116 }; 117 };
117 }); 118 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698