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