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 Page = cr.ui.pageManager.Page; | 6 var Page = cr.ui.pageManager.Page; |
7 var PageManager = cr.ui.pageManager.PageManager; | 7 var PageManager = cr.ui.pageManager.PageManager; |
8 var ArrayDataModel = cr.ui.ArrayDataModel; | 8 var ArrayDataModel = cr.ui.ArrayDataModel; |
9 | 9 |
10 /** | 10 /** |
(...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
591 /** | 591 /** |
592 * Display the "Create Profile" dialog. | 592 * Display the "Create Profile" dialog. |
593 * @private | 593 * @private |
594 */ | 594 */ |
595 showCreateDialog_: function() { | 595 showCreateDialog_: function() { |
596 PageManager.showPageByName('createProfile'); | 596 PageManager.showPageByName('createProfile'); |
597 }, | 597 }, |
598 }; | 598 }; |
599 | 599 |
600 // Forward public APIs to private implementations. | 600 // Forward public APIs to private implementations. |
601 [ | 601 cr.makePublic(ManageProfileOverlay, [ |
602 'receiveDefaultProfileIconsAndNames', | 602 'receiveDefaultProfileIconsAndNames', |
603 'receiveNewProfileDefaults', | 603 'receiveNewProfileDefaults', |
604 'receiveExistingProfileNames', | 604 'receiveExistingProfileNames', |
605 'receiveHasProfileShortcuts', | 605 'receiveHasProfileShortcuts', |
606 'setProfileInfo', | 606 'setProfileInfo', |
607 'setProfileName', | 607 'setProfileName', |
608 'showManageDialog', | 608 'showManageDialog', |
609 'showDeleteDialog', | 609 'showDeleteDialog', |
610 'showDisconnectManagedProfileDialog', | 610 'showDisconnectManagedProfileDialog', |
611 'showCreateDialog', | 611 'showCreateDialog', |
612 ].forEach(function(name) { | 612 ]); |
613 ManageProfileOverlay[name] = function() { | |
614 var instance = ManageProfileOverlay.getInstance(); | |
615 return instance[name + '_'].apply(instance, arguments); | |
616 }; | |
617 }); | |
618 | 613 |
619 function CreateProfileOverlay() { | 614 function CreateProfileOverlay() { |
620 Page.call(this, 'createProfile', | 615 Page.call(this, 'createProfile', |
621 loadTimeData.getString('createProfileTabTitle'), | 616 loadTimeData.getString('createProfileTabTitle'), |
622 'manage-profile-overlay'); | 617 'manage-profile-overlay'); |
623 }; | 618 }; |
624 | 619 |
625 cr.addSingletonGetter(CreateProfileOverlay); | 620 cr.addSingletonGetter(CreateProfileOverlay); |
626 | 621 |
627 CreateProfileOverlay.prototype = { | 622 CreateProfileOverlay.prototype = { |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
847 * @private | 842 * @private |
848 */ | 843 */ |
849 updateCreateSupervisedUserCheckbox_: function() { | 844 updateCreateSupervisedUserCheckbox_: function() { |
850 $('create-profile-supervised').disabled = | 845 $('create-profile-supervised').disabled = |
851 !this.supervisedUsersAllowed_ || this.createInProgress_ || | 846 !this.supervisedUsersAllowed_ || this.createInProgress_ || |
852 this.signedInEmail_ == '' || this.hasError_; | 847 this.signedInEmail_ == '' || this.hasError_; |
853 }, | 848 }, |
854 }; | 849 }; |
855 | 850 |
856 // Forward public APIs to private implementations. | 851 // Forward public APIs to private implementations. |
857 [ | 852 cr.makePublic(CreateProfileOverlay, [ |
858 'cancelCreateProfile', | 853 'cancelCreateProfile', |
859 'onError', | 854 'onError', |
860 'onSuccess', | 855 'onSuccess', |
861 'onWarning', | 856 'onWarning', |
862 'updateCreateInProgress', | 857 'updateCreateInProgress', |
863 'updateSignedInStatus', | 858 'updateSignedInStatus', |
864 'updateSupervisedUsersAllowed', | 859 'updateSupervisedUsersAllowed', |
865 ].forEach(function(name) { | 860 ]); |
866 CreateProfileOverlay[name] = function() { | |
867 var instance = CreateProfileOverlay.getInstance(); | |
868 return instance[name + '_'].apply(instance, arguments); | |
869 }; | |
870 }); | |
871 | 861 |
872 // Export | 862 // Export |
873 return { | 863 return { |
874 ManageProfileOverlay: ManageProfileOverlay, | 864 ManageProfileOverlay: ManageProfileOverlay, |
875 CreateProfileOverlay: CreateProfileOverlay, | 865 CreateProfileOverlay: CreateProfileOverlay, |
876 }; | 866 }; |
877 }); | 867 }); |
OLD | NEW |