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

Side by Side Diff: chrome/browser/resources/options/manage_profile_overlay.js

Issue 557633002: Add public API generation with cr.makePublic() and handle it in compiler pass (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@H_options_errors_3
Patch Set: fixed some dbeam@'s comments Created 6 years, 3 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 (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
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
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 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698