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

Side by Side Diff: chrome/browser/resources/md_user_manager/create_profile.js

Issue 2223743003: MD User Manager: Changes to 'import supervised users' dialog. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments Created 4 years, 4 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 /** 5 /**
6 * @fileoverview 'create-profile' is a page that contains controls for creating 6 * @fileoverview 'create-profile' is a page that contains controls for creating
7 * a (optionally supervised) profile, including choosing a name, and an avatar. 7 * a (optionally supervised) profile, including choosing a name, and an avatar.
8 */ 8 */
9 9
10 /** @typedef {{url: string, label:string}} */ 10 /** @typedef {{url: string, label:string}} */
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 var signedInUser = this.signedInUser_(this.signedInUserIndex_); 259 var signedInUser = this.signedInUser_(this.signedInUserIndex_);
260 this.hideMessage_(); 260 this.hideMessage_();
261 this.loadingSupervisedUsers_ = true; 261 this.loadingSupervisedUsers_ = true;
262 this.browserProxy_.getExistingSupervisedUsers(signedInUser.profilePath) 262 this.browserProxy_.getExistingSupervisedUsers(signedInUser.profilePath)
263 .then(this.createProfileIfValidSupervisedUser_.bind(this), 263 .then(this.createProfileIfValidSupervisedUser_.bind(this),
264 this.handleMessage_.bind(this)); 264 this.handleMessage_.bind(this));
265 } 265 }
266 }, 266 },
267 267
268 /** 268 /**
269 * Displays the import supervised user popup. 269 * Displays the import supervised user popup or an error message if there are
270 * no existing supervised users.
270 * @param {!Array<!SupervisedUser>} supervisedUsers The list of existing 271 * @param {!Array<!SupervisedUser>} supervisedUsers The list of existing
271 * supervised users. 272 * supervised users.
272 * @private 273 * @private
273 */ 274 */
274 showImportSupervisedUserPopup_: function(supervisedUsers) { 275 showImportSupervisedUserPopup_: function(supervisedUsers) {
275 this.loadingSupervisedUsers_ = false; 276 this.loadingSupervisedUsers_ = false;
276 this.$.importUserPopup.show(this.signedInUser_(this.signedInUserIndex_), 277 if (supervisedUsers.length > 0) {
277 supervisedUsers); 278 this.$.importUserPopup.show(this.signedInUser_(this.signedInUserIndex_),
279 supervisedUsers);
280 } else {
281 this.handleMessage_(this.i18n('noSupervisedUserImportText'));
282 }
278 }, 283 },
279 284
280 /** 285 /**
281 * Checks if the entered name matches name of an existing supervised user. 286 * Checks if the entered name matches name of an existing supervised user.
282 * If yes, the user is prompted to import the existing supervised user. 287 * If yes, the user is prompted to import the existing supervised user.
283 * If no, the new supervised profile gets created. 288 * If no, the new supervised profile gets created.
284 * @param {!Array<!SupervisedUser>} supervisedUsers The list of existing 289 * @param {!Array<!SupervisedUser>} supervisedUsers The list of existing
285 * supervised users. 290 * supervised users.
286 * @private 291 * @private
287 */ 292 */
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 * Computed binding that returns True if there are any signed-in users. 508 * Computed binding that returns True if there are any signed-in users.
504 * @param {!Array<!SignedInUser>} signedInUsers signed-in users. 509 * @param {!Array<!SignedInUser>} signedInUsers signed-in users.
505 * @return {boolean} 510 * @return {boolean}
506 * @private 511 * @private
507 */ 512 */
508 isSignedIn_: function(signedInUsers) { 513 isSignedIn_: function(signedInUsers) {
509 return signedInUsers.length > 0; 514 return signedInUsers.length > 0;
510 } 515 }
511 }); 516 });
512 }()); 517 }());
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698