Chromium Code Reviews| Index: chrome/browser/resources/settings/people_page/people_page.js |
| diff --git a/chrome/browser/resources/settings/people_page/people_page.js b/chrome/browser/resources/settings/people_page/people_page.js |
| index 7330a8ccb982cd4f7aabc5ba82788b65abbdef8d..6d20ef2e0126b03f1080215a6a87753bf4b51838 100644 |
| --- a/chrome/browser/resources/settings/people_page/people_page.js |
| +++ b/chrome/browser/resources/settings/people_page/people_page.js |
| @@ -46,6 +46,14 @@ Polymer({ |
| */ |
| profileName_: String, |
| + /** |
| + * True if the current profile manages supervised users. |
| + */ |
| + profileManagesSupervisedUsers_: { |
| + type: Boolean, |
| + value: false, |
|
hcarmona
2016/06/10 22:58:08
Is the default necessary? This is always set on at
tommycli
2016/06/10 23:28:45
Done.
|
| + }, |
| + |
| /** @private {!settings.SyncBrowserProxyImpl} */ |
| syncBrowserProxy_: { |
| type: Object, |
| @@ -112,11 +120,16 @@ Polymer({ |
| /** @override */ |
| attached: function() { |
| - settings.ProfileInfoBrowserProxyImpl.getInstance().getProfileInfo().then( |
| - this.handleProfileInfo_.bind(this)); |
| + var profileInfoProxy = settings.ProfileInfoBrowserProxyImpl.getInstance(); |
| + profileInfoProxy.getProfileInfo().then(this.handleProfileInfo_.bind(this)); |
| this.addWebUIListener('profile-info-changed', |
| this.handleProfileInfo_.bind(this)); |
| + profileInfoProxy.getProfileManagesSupervisedUsers().then( |
| + this.handleProfileManagesSupervisedUsers_.bind(this)); |
| + this.addWebUIListener('profile-manages-supervised-users-changed', |
| + this.handleProfileManagesSupervisedUsers_.bind(this)); |
| + |
| this.syncBrowserProxy_.getSyncStatus().then( |
| this.handleSyncStatus_.bind(this)); |
| this.addWebUIListener('sync-status-changed', |
| @@ -144,6 +157,15 @@ Polymer({ |
| }, |
| /** |
| + * Handler for when the profile starts or stops managing supervised users. |
| + * @private |
| + * @param {boolean} managesSupervisedUsers |
| + */ |
| + handleProfileManagesSupervisedUsers_: function(managesSupervisedUsers) { |
| + this.profileManagesSupervisedUsers_ = managesSupervisedUsers; |
| + }, |
| + |
| + /** |
| * Handler for when the sync state is pushed from the browser. |
| * @param {?settings.SyncStatus} syncStatus |
| * @private |
| @@ -235,6 +257,11 @@ Polymer({ |
| </if> |
| }, |
| + /** @private */ |
| + onManageSupervisedUsers_: function() { |
| + window.open(loadTimeData.getString('supervisedUsersUrl')); |
| + }, |
| + |
| /** |
| * @private |
| * @param {?settings.SyncStatus} syncStatus |