Chromium Code Reviews| 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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 138 * @private | 138 * @private |
| 139 * @param {!settings.ProfileInfo} info | 139 * @param {!settings.ProfileInfo} info |
| 140 */ | 140 */ |
| 141 handleProfileInfo_: function(info) { | 141 handleProfileInfo_: function(info) { |
| 142 this.profileName_ = info.name; | 142 this.profileName_ = info.name; |
| 143 this.profileIconUrl_ = info.iconUrl; | 143 this.profileIconUrl_ = info.iconUrl; |
| 144 }, | 144 }, |
| 145 | 145 |
| 146 /** | 146 /** |
| 147 * Handler for when the sync state is pushed from the browser. | 147 * Handler for when the sync state is pushed from the browser. |
| 148 * @param {?settings.SyncStatus} syncStatus | |
| 148 * @private | 149 * @private |
| 149 */ | 150 */ |
| 150 handleSyncStatus_: function(syncStatus) { | 151 handleSyncStatus_: function(syncStatus) { |
| 151 this.syncStatus = syncStatus; | 152 this.syncStatus = syncStatus; |
| 152 | |
| 153 // TODO(tommycli): Remove once we figure out how to refactor the sync | |
| 154 // code to not include HTML in the status messages. | |
| 155 this.$.syncStatusText.innerHTML = syncStatus.statusText; | |
| 156 }, | 153 }, |
| 157 | 154 |
| 158 <if expr="chromeos"> | 155 <if expr="chromeos"> |
| 159 /** | 156 /** |
| 160 * Handler for when the Easy Unlock enabled status has changed. | 157 * Handler for when the Easy Unlock enabled status has changed. |
| 161 * @private | 158 * @private |
| 162 */ | 159 */ |
| 163 handleEasyUnlockEnabledStatusChanged_: function(easyUnlockEnabled) { | 160 handleEasyUnlockEnabledStatusChanged_: function(easyUnlockEnabled) { |
| 164 this.easyUnlockEnabled_ = easyUnlockEnabled; | 161 this.easyUnlockEnabled_ = easyUnlockEnabled; |
| 165 }, | 162 }, |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 200 /** @private */ | 197 /** @private */ |
| 201 onDisconnectConfirm_: function() { | 198 onDisconnectConfirm_: function() { |
| 202 var deleteProfile = this.$.deleteProfile && this.$.deleteProfile.checked; | 199 var deleteProfile = this.$.deleteProfile && this.$.deleteProfile.checked; |
| 203 this.syncBrowserProxy_.signOut(deleteProfile); | 200 this.syncBrowserProxy_.signOut(deleteProfile); |
| 204 | 201 |
| 205 // Dialog automatically closed because button has dialog-confirm attribute. | 202 // Dialog automatically closed because button has dialog-confirm attribute. |
| 206 }, | 203 }, |
| 207 | 204 |
| 208 /** @private */ | 205 /** @private */ |
| 209 onSyncTap_: function() { | 206 onSyncTap_: function() { |
| 207 assert(this.syncStatus.signedIn); | |
| 208 assert(this.syncStatus.syncSystemEnabled); | |
| 209 | |
| 210 if (this.syncStatus.managed) | |
| 211 return; | |
| 212 | |
| 210 this.$.pages.setSubpageChain(['sync']); | 213 this.$.pages.setSubpageChain(['sync']); |
| 211 }, | 214 }, |
| 212 | 215 |
| 213 <if expr="chromeos"> | 216 <if expr="chromeos"> |
| 214 /** @private */ | 217 /** @private */ |
| 215 onEasyUnlockSetupTap_: function() { | 218 onEasyUnlockSetupTap_: function() { |
| 216 this.easyUnlockBrowserProxy_.startTurnOnFlow(); | 219 this.easyUnlockBrowserProxy_.startTurnOnFlow(); |
| 217 }, | 220 }, |
| 218 | 221 |
| 219 /** @private */ | 222 /** @private */ |
| 220 onEasyUnlockTurnOffTap_: function() { | 223 onEasyUnlockTurnOffTap_: function() { |
| 221 this.$$('#easyUnlockTurnOffDialog').open(); | 224 this.$$('#easyUnlockTurnOffDialog').open(); |
| 222 }, | 225 }, |
| 223 </if> | 226 </if> |
| 224 | 227 |
| 225 /** @private */ | 228 /** @private */ |
| 226 onManageOtherPeople_: function() { | 229 onManageOtherPeople_: function() { |
| 227 <if expr="not chromeos"> | 230 <if expr="not chromeos"> |
| 228 this.syncBrowserProxy_.manageOtherPeople(); | 231 this.syncBrowserProxy_.manageOtherPeople(); |
| 229 </if> | 232 </if> |
| 230 <if expr="chromeos"> | 233 <if expr="chromeos"> |
| 231 this.$.pages.setSubpageChain(['users']); | 234 this.$.pages.setSubpageChain(['users']); |
| 232 </if> | 235 </if> |
| 233 }, | 236 }, |
| 234 | 237 |
| 235 /** | 238 /** |
| 236 * @private | 239 * @private |
| 240 * @param {?settings.SyncStatus} syncStatus | |
| 237 * @return {boolean} | 241 * @return {boolean} |
| 238 */ | 242 */ |
| 239 isStatusTextSet_: function(syncStatus) { | 243 isAdvancedSyncSettingsVisible_: function(syncStatus) { |
| 240 return syncStatus && syncStatus.statusText.length > 0; | 244 return !!syncStatus && !!syncStatus.signedIn && |
| 245 !!syncStatus.syncSystemEnabled; | |
|
tommycli
2016/05/18 18:31:47
This was necessary to make the closure compiler ha
| |
| 241 }, | 246 }, |
| 242 | 247 |
| 243 /** | 248 /** |
| 244 * @private | 249 * @private |
| 245 * @return {boolean} | 250 * @param {?settings.SyncStatus} syncStatus |
| 251 * @return {string} | |
| 246 */ | 252 */ |
| 247 isAdvancedSyncSettingsVisible_: function(syncStatus) { | 253 getSyncIcon_: function(syncStatus) { |
| 248 return syncStatus && syncStatus.signedIn && !syncStatus.managed && | 254 if (!syncStatus) |
| 249 syncStatus.syncSystemEnabled; | 255 return ''; |
| 256 if (syncStatus.hasError) | |
| 257 return 'settings:sync-problem'; | |
| 258 if (syncStatus.managed) | |
| 259 return 'settings:sync-disabled'; | |
| 260 | |
| 261 return 'settings:done'; | |
| 250 }, | 262 }, |
| 251 }); | 263 }); |
| OLD | NEW |