OLD | NEW |
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 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
477 profileName) { | 477 profileName) { |
478 // TODO(mahmadi): Figure out a way to add 'paper-input-extracted' as a | 478 // TODO(mahmadi): Figure out a way to add 'paper-input-extracted' as a |
479 // dependency and cast to PaperInputElement instead. | 479 // dependency and cast to PaperInputElement instead. |
480 /** @type {{validate: function():boolean}} */ | 480 /** @type {{validate: function():boolean}} */ |
481 var nameInput = this.$.nameInput; | 481 var nameInput = this.$.nameInput; |
482 return createInProgress || loadingSupervisedUsers || !profileName || | 482 return createInProgress || loadingSupervisedUsers || !profileName || |
483 !nameInput.validate(); | 483 !nameInput.validate(); |
484 }, | 484 }, |
485 | 485 |
486 /** | 486 /** |
487 * Returns True if the import supervised user link should be hidden. | 487 * Returns True if the import existing supervised user link should be hidden. |
488 * @param {boolean} createInProgress True if create/import is in progress | 488 * @param {boolean} createInProgress True if create/import is in progress. |
| 489 * @param {boolean} loadingSupervisedUsers True if supervised users are being |
| 490 * loaded. |
489 * @param {number} signedInUserIndex Index of the selected signed-in user. | 491 * @param {number} signedInUserIndex Index of the selected signed-in user. |
490 * @return {boolean} | 492 * @return {boolean} |
491 * @private | 493 * @private |
492 */ | 494 */ |
493 isImportUserLinkHidden_: function(createInProgress, signedInUserIndex) { | 495 isImportUserLinkHidden_: function(createInProgress, |
494 return createInProgress || !this.signedInUser_(signedInUserIndex); | 496 loadingSupervisedUsers, |
| 497 signedInUserIndex) { |
| 498 return createInProgress || loadingSupervisedUsers || |
| 499 !this.signedInUser_(signedInUserIndex); |
495 }, | 500 }, |
496 | 501 |
497 /** | 502 /** |
498 * Computed binding that returns True if there are any signed-in users. | 503 * Computed binding that returns True if there are any signed-in users. |
499 * @param {!Array<!SignedInUser>} signedInUsers signed-in users. | 504 * @param {!Array<!SignedInUser>} signedInUsers signed-in users. |
500 * @return {boolean} | 505 * @return {boolean} |
501 * @private | 506 * @private |
502 */ | 507 */ |
503 isSignedIn_: function(signedInUsers) { | 508 isSignedIn_: function(signedInUsers) { |
504 return signedInUsers.length > 0; | 509 return signedInUsers.length > 0; |
505 } | 510 } |
506 }); | 511 }); |
507 }()); | 512 }()); |
OLD | NEW |