| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 /** | 5 /** |
| 6 * @fileoverview | 6 * @fileoverview |
| 7 * 'settings-people-page' is the settings page containing sign-in settings. | 7 * 'settings-people-page' is the settings page containing sign-in settings. |
| 8 */ | 8 */ |
| 9 Polymer({ | 9 Polymer({ |
| 10 is: 'settings-people-page', | 10 is: 'settings-people-page', |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 /** | 39 /** |
| 40 * The currently selected profile icon URL. May be a data URL. | 40 * The currently selected profile icon URL. May be a data URL. |
| 41 */ | 41 */ |
| 42 profileIconUrl_: String, | 42 profileIconUrl_: String, |
| 43 | 43 |
| 44 /** | 44 /** |
| 45 * The current profile name. | 45 * The current profile name. |
| 46 */ | 46 */ |
| 47 profileName_: String, | 47 profileName_: String, |
| 48 | 48 |
| 49 /** |
| 50 * True if the current profile manages supervised users. |
| 51 */ |
| 52 profileManagesSupervisedUsers_: Boolean, |
| 53 |
| 49 /** @private {!settings.SyncBrowserProxyImpl} */ | 54 /** @private {!settings.SyncBrowserProxyImpl} */ |
| 50 syncBrowserProxy_: { | 55 syncBrowserProxy_: { |
| 51 type: Object, | 56 type: Object, |
| 52 value: function() { | 57 value: function() { |
| 53 return settings.SyncBrowserProxyImpl.getInstance(); | 58 return settings.SyncBrowserProxyImpl.getInstance(); |
| 54 }, | 59 }, |
| 55 }, | 60 }, |
| 56 | 61 |
| 57 <if expr="chromeos"> | 62 <if expr="chromeos"> |
| 58 /** | 63 /** |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 return loadTimeData.getBoolean('easyUnlockAllowed') && | 110 return loadTimeData.getBoolean('easyUnlockAllowed') && |
| 106 loadTimeData.getBoolean('easyUnlockProximityDetectionAllowed'); | 111 loadTimeData.getBoolean('easyUnlockProximityDetectionAllowed'); |
| 107 }, | 112 }, |
| 108 readOnly: true, | 113 readOnly: true, |
| 109 }, | 114 }, |
| 110 </if> | 115 </if> |
| 111 }, | 116 }, |
| 112 | 117 |
| 113 /** @override */ | 118 /** @override */ |
| 114 attached: function() { | 119 attached: function() { |
| 115 settings.ProfileInfoBrowserProxyImpl.getInstance().getProfileInfo().then( | 120 var profileInfoProxy = settings.ProfileInfoBrowserProxyImpl.getInstance(); |
| 116 this.handleProfileInfo_.bind(this)); | 121 profileInfoProxy.getProfileInfo().then(this.handleProfileInfo_.bind(this)); |
| 117 this.addWebUIListener('profile-info-changed', | 122 this.addWebUIListener('profile-info-changed', |
| 118 this.handleProfileInfo_.bind(this)); | 123 this.handleProfileInfo_.bind(this)); |
| 119 | 124 |
| 125 profileInfoProxy.getProfileManagesSupervisedUsers().then( |
| 126 this.handleProfileManagesSupervisedUsers_.bind(this)); |
| 127 this.addWebUIListener('profile-manages-supervised-users-changed', |
| 128 this.handleProfileManagesSupervisedUsers_.bind(this)); |
| 129 |
| 120 this.syncBrowserProxy_.getSyncStatus().then( | 130 this.syncBrowserProxy_.getSyncStatus().then( |
| 121 this.handleSyncStatus_.bind(this)); | 131 this.handleSyncStatus_.bind(this)); |
| 122 this.addWebUIListener('sync-status-changed', | 132 this.addWebUIListener('sync-status-changed', |
| 123 this.handleSyncStatus_.bind(this)); | 133 this.handleSyncStatus_.bind(this)); |
| 124 | 134 |
| 125 <if expr="chromeos"> | 135 <if expr="chromeos"> |
| 126 if (this.easyUnlockAllowed_) { | 136 if (this.easyUnlockAllowed_) { |
| 127 this.addWebUIListener( | 137 this.addWebUIListener( |
| 128 'easy-unlock-enabled-status', | 138 'easy-unlock-enabled-status', |
| 129 this.handleEasyUnlockEnabledStatusChanged_.bind(this)); | 139 this.handleEasyUnlockEnabledStatusChanged_.bind(this)); |
| 130 this.easyUnlockBrowserProxy_.getEnabledStatus().then( | 140 this.easyUnlockBrowserProxy_.getEnabledStatus().then( |
| 131 this.handleEasyUnlockEnabledStatusChanged_.bind(this)); | 141 this.handleEasyUnlockEnabledStatusChanged_.bind(this)); |
| 132 } | 142 } |
| 133 </if> | 143 </if> |
| 134 }, | 144 }, |
| 135 | 145 |
| 136 /** | 146 /** |
| 137 * Handler for when the profile's icon and name is updated. | 147 * Handler for when the profile's icon and name is updated. |
| 138 * @private | 148 * @private |
| 139 * @param {!settings.ProfileInfo} info | 149 * @param {!settings.ProfileInfo} info |
| 140 */ | 150 */ |
| 141 handleProfileInfo_: function(info) { | 151 handleProfileInfo_: function(info) { |
| 142 this.profileName_ = info.name; | 152 this.profileName_ = info.name; |
| 143 this.profileIconUrl_ = info.iconUrl; | 153 this.profileIconUrl_ = info.iconUrl; |
| 144 }, | 154 }, |
| 145 | 155 |
| 146 /** | 156 /** |
| 157 * Handler for when the profile starts or stops managing supervised users. |
| 158 * @private |
| 159 * @param {boolean} managesSupervisedUsers |
| 160 */ |
| 161 handleProfileManagesSupervisedUsers_: function(managesSupervisedUsers) { |
| 162 this.profileManagesSupervisedUsers_ = managesSupervisedUsers; |
| 163 }, |
| 164 |
| 165 /** |
| 147 * Handler for when the sync state is pushed from the browser. | 166 * Handler for when the sync state is pushed from the browser. |
| 148 * @param {?settings.SyncStatus} syncStatus | 167 * @param {?settings.SyncStatus} syncStatus |
| 149 * @private | 168 * @private |
| 150 */ | 169 */ |
| 151 handleSyncStatus_: function(syncStatus) { | 170 handleSyncStatus_: function(syncStatus) { |
| 152 this.syncStatus = syncStatus; | 171 this.syncStatus = syncStatus; |
| 153 }, | 172 }, |
| 154 | 173 |
| 155 <if expr="chromeos"> | 174 <if expr="chromeos"> |
| 156 /** | 175 /** |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 /** @private */ | 247 /** @private */ |
| 229 onManageOtherPeople_: function() { | 248 onManageOtherPeople_: function() { |
| 230 <if expr="not chromeos"> | 249 <if expr="not chromeos"> |
| 231 this.syncBrowserProxy_.manageOtherPeople(); | 250 this.syncBrowserProxy_.manageOtherPeople(); |
| 232 </if> | 251 </if> |
| 233 <if expr="chromeos"> | 252 <if expr="chromeos"> |
| 234 this.$.pages.setSubpageChain(['users']); | 253 this.$.pages.setSubpageChain(['users']); |
| 235 </if> | 254 </if> |
| 236 }, | 255 }, |
| 237 | 256 |
| 257 /** @private */ |
| 258 onManageSupervisedUsers_: function() { |
| 259 window.open(loadTimeData.getString('supervisedUsersUrl')); |
| 260 }, |
| 261 |
| 238 /** | 262 /** |
| 239 * @private | 263 * @private |
| 240 * @param {?settings.SyncStatus} syncStatus | 264 * @param {?settings.SyncStatus} syncStatus |
| 241 * @return {boolean} | 265 * @return {boolean} |
| 242 */ | 266 */ |
| 243 isAdvancedSyncSettingsVisible_: function(syncStatus) { | 267 isAdvancedSyncSettingsVisible_: function(syncStatus) { |
| 244 return !!syncStatus && !!syncStatus.signedIn && | 268 return !!syncStatus && !!syncStatus.signedIn && |
| 245 !!syncStatus.syncSystemEnabled; | 269 !!syncStatus.syncSystemEnabled; |
| 246 }, | 270 }, |
| 247 | 271 |
| 248 /** | 272 /** |
| 249 * @private | 273 * @private |
| 250 * @param {?settings.SyncStatus} syncStatus | 274 * @param {?settings.SyncStatus} syncStatus |
| 251 * @return {string} | 275 * @return {string} |
| 252 */ | 276 */ |
| 253 getSyncIcon_: function(syncStatus) { | 277 getSyncIcon_: function(syncStatus) { |
| 254 if (!syncStatus) | 278 if (!syncStatus) |
| 255 return ''; | 279 return ''; |
| 256 if (syncStatus.hasError) | 280 if (syncStatus.hasError) |
| 257 return 'settings:sync-problem'; | 281 return 'settings:sync-problem'; |
| 258 if (syncStatus.managed) | 282 if (syncStatus.managed) |
| 259 return 'settings:sync-disabled'; | 283 return 'settings:sync-disabled'; |
| 260 | 284 |
| 261 return 'settings:done'; | 285 return 'settings:done'; |
| 262 }, | 286 }, |
| 263 }); | 287 }); |
| OLD | NEW |