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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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 * @private | 148 * @private |
| 149 */ | 149 */ |
| 150 handleSyncStatus_: function(syncStatus) { | 150 handleSyncStatus_: function(syncStatus) { |
| 151 this.syncStatus = syncStatus; | 151 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 }, | 152 }, |
| 157 | 153 |
| 158 <if expr="chromeos"> | 154 <if expr="chromeos"> |
| 159 /** | 155 /** |
| 160 * Handler for when the Easy Unlock enabled status has changed. | 156 * Handler for when the Easy Unlock enabled status has changed. |
| 161 * @private | 157 * @private |
| 162 */ | 158 */ |
| 163 handleEasyUnlockEnabledStatusChanged_: function(easyUnlockEnabled) { | 159 handleEasyUnlockEnabledStatusChanged_: function(easyUnlockEnabled) { |
| 164 this.easyUnlockEnabled_ = easyUnlockEnabled; | 160 this.easyUnlockEnabled_ = easyUnlockEnabled; |
| 165 }, | 161 }, |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 200 /** @private */ | 196 /** @private */ |
| 201 onDisconnectConfirm_: function() { | 197 onDisconnectConfirm_: function() { |
| 202 var deleteProfile = this.$.deleteProfile && this.$.deleteProfile.checked; | 198 var deleteProfile = this.$.deleteProfile && this.$.deleteProfile.checked; |
| 203 this.syncBrowserProxy_.signOut(deleteProfile); | 199 this.syncBrowserProxy_.signOut(deleteProfile); |
| 204 | 200 |
| 205 // Dialog automatically closed because button has dialog-confirm attribute. | 201 // Dialog automatically closed because button has dialog-confirm attribute. |
| 206 }, | 202 }, |
| 207 | 203 |
| 208 /** @private */ | 204 /** @private */ |
| 209 onSyncTap_: function() { | 205 onSyncTap_: function() { |
| 206 if (!this.syncStatus.signedIn || this.syncStatus.managed || | |
| 207 !this.syncStatus.syncSystemEnabled) { | |
|
dschuyler
2016/05/18 00:08:00
Can these reasonably happen?
Or is this action una
tommycli
2016/05/18 18:31:46
Done. I made the two that can't reasonably happen
| |
| 208 return; | |
| 209 } | |
| 210 | |
| 210 this.$.pages.setSubpageChain(['sync']); | 211 this.$.pages.setSubpageChain(['sync']); |
| 211 }, | 212 }, |
| 212 | 213 |
| 213 <if expr="chromeos"> | 214 <if expr="chromeos"> |
| 214 /** @private */ | 215 /** @private */ |
| 215 onEasyUnlockSetupTap_: function() { | 216 onEasyUnlockSetupTap_: function() { |
| 216 this.easyUnlockBrowserProxy_.startTurnOnFlow(); | 217 this.easyUnlockBrowserProxy_.startTurnOnFlow(); |
| 217 }, | 218 }, |
| 218 | 219 |
| 219 /** @private */ | 220 /** @private */ |
| 220 onEasyUnlockTurnOffTap_: function() { | 221 onEasyUnlockTurnOffTap_: function() { |
| 221 this.$$('#easyUnlockTurnOffDialog').open(); | 222 this.$$('#easyUnlockTurnOffDialog').open(); |
| 222 }, | 223 }, |
| 223 </if> | 224 </if> |
| 224 | 225 |
| 225 /** @private */ | 226 /** @private */ |
| 226 onManageOtherPeople_: function() { | 227 onManageOtherPeople_: function() { |
| 227 <if expr="not chromeos"> | 228 <if expr="not chromeos"> |
| 228 this.syncBrowserProxy_.manageOtherPeople(); | 229 this.syncBrowserProxy_.manageOtherPeople(); |
| 229 </if> | 230 </if> |
| 230 <if expr="chromeos"> | 231 <if expr="chromeos"> |
| 231 this.$.pages.setSubpageChain(['users']); | 232 this.$.pages.setSubpageChain(['users']); |
| 232 </if> | 233 </if> |
| 233 }, | 234 }, |
| 234 | 235 |
| 235 /** | 236 /** |
| 236 * @private | 237 * @private |
|
dschuyler
2016/05/18 00:08:00
@param for syncStatus
tommycli
2016/05/18 18:31:46
Done.
| |
| 237 * @return {boolean} | 238 * @return {boolean} |
| 238 */ | 239 */ |
| 239 isStatusTextSet_: function(syncStatus) { | 240 isAdvancedSyncSettingsVisible_: function(syncStatus) { |
| 240 return syncStatus && syncStatus.statusText.length > 0; | 241 return syncStatus && syncStatus.signedIn && syncStatus.syncSystemEnabled; |
| 241 }, | 242 }, |
| 242 | 243 |
| 243 /** | 244 /** |
| 244 * @private | 245 * @private |
|
dschuyler
2016/05/18 00:08:00
@param for syncStatus
tommycli
2016/05/18 18:31:46
Done.
| |
| 245 * @return {boolean} | 246 * @return {string} |
| 246 */ | 247 */ |
| 247 isAdvancedSyncSettingsVisible_: function(syncStatus) { | 248 getSyncIcon_: function(syncStatus) { |
| 248 return syncStatus && syncStatus.signedIn && !syncStatus.managed && | 249 if (!syncStatus) |
| 249 syncStatus.syncSystemEnabled; | 250 return ''; |
| 251 if (syncStatus.hasError) | |
| 252 return 'settings:sync-problem'; | |
| 253 if (syncStatus.managed) | |
| 254 return 'settings:sync-disabled'; | |
| 255 | |
| 256 return 'settings:done'; | |
| 257 }, | |
| 258 | |
| 259 /** | |
| 260 * @private | |
|
dschuyler
2016/05/18 00:08:00
@param
tommycli
2016/05/18 18:31:46
Done.
| |
| 261 * @return {string} | |
| 262 */ | |
| 263 getSyncStatusClass_: function(syncStatus) { | |
| 264 return (syncStatus && syncStatus.hasError) ? 'sync-error' : ''; | |
| 250 }, | 265 }, |
| 251 }); | 266 }); |
| OLD | NEW |