OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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', function() { | 5 cr.define('options', function() { |
6 var OptionsPage = options.OptionsPage; | 6 var OptionsPage = options.OptionsPage; |
7 var ArrayDataModel = cr.ui.ArrayDataModel; | 7 var ArrayDataModel = cr.ui.ArrayDataModel; |
8 | 8 |
9 /** | 9 /** |
10 * ManageProfileOverlay class | 10 * ManageProfileOverlay class |
(...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
610 * @param {boolean} hasError Whether the user's sign-in credentials are | 610 * @param {boolean} hasError Whether the user's sign-in credentials are |
611 * still valid. | 611 * still valid. |
612 * @private | 612 * @private |
613 */ | 613 */ |
614 updateSignedInStatus_: function(email, hasError) { | 614 updateSignedInStatus_: function(email, hasError) { |
615 this.signedInEmail_ = email; | 615 this.signedInEmail_ = email; |
616 this.hasError_ = hasError; | 616 this.hasError_ = hasError; |
617 var isSignedIn = email !== ''; | 617 var isSignedIn = email !== ''; |
618 $('create-profile-managed-signed-in').hidden = !isSignedIn; | 618 $('create-profile-managed-signed-in').hidden = !isSignedIn; |
619 $('create-profile-managed-not-signed-in').hidden = isSignedIn; | 619 $('create-profile-managed-not-signed-in').hidden = isSignedIn; |
620 $('select-existing-managed-profile-checkbox').hidden = !isSignedIn; | 620 var hideSelectExistingManagedUsers = |
621 $('choose-existing-managed-profile').hidden = !isSignedIn; | 621 !isSignedIn || |
| 622 !loadTimeData.getBoolean('allowCreateExistingManagedUsers'); |
| 623 $('select-existing-managed-profile-checkbox').hidden = |
| 624 hideSelectExistingManagedUsers; |
| 625 $('choose-existing-managed-profile').hidden = |
| 626 hideSelectExistingManagedUsers; |
622 | 627 |
623 if (isSignedIn) { | 628 if (isSignedIn) { |
624 var accountDetailsOutOfDate = | 629 var accountDetailsOutOfDate = |
625 $('create-profile-managed-account-details-out-of-date-label'); | 630 $('create-profile-managed-account-details-out-of-date-label'); |
626 accountDetailsOutOfDate.textContent = loadTimeData.getStringF( | 631 accountDetailsOutOfDate.textContent = loadTimeData.getStringF( |
627 'manageProfilesManagedAccountDetailsOutOfDate', email); | 632 'manageProfilesManagedAccountDetailsOutOfDate', email); |
628 accountDetailsOutOfDate.hidden = !hasError; | 633 accountDetailsOutOfDate.hidden = !hasError; |
629 | 634 |
630 $('create-profile-managed-signed-in-label').textContent = | 635 $('create-profile-managed-signed-in-label').textContent = |
631 loadTimeData.getStringF( | 636 loadTimeData.getStringF( |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
714 return instance[name + '_'].apply(instance, arguments); | 719 return instance[name + '_'].apply(instance, arguments); |
715 }; | 720 }; |
716 }); | 721 }); |
717 | 722 |
718 // Export | 723 // Export |
719 return { | 724 return { |
720 ManageProfileOverlay: ManageProfileOverlay, | 725 ManageProfileOverlay: ManageProfileOverlay, |
721 CreateProfileOverlay: CreateProfileOverlay, | 726 CreateProfileOverlay: CreateProfileOverlay, |
722 }; | 727 }; |
723 }); | 728 }); |
OLD | NEW |