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 ef135b7018ce9fd9c14721b77b6b2f077ba982ec..7330a8ccb982cd4f7aabc5ba82788b65abbdef8d 100644 |
| --- a/chrome/browser/resources/settings/people_page/people_page.js |
| +++ b/chrome/browser/resources/settings/people_page/people_page.js |
| @@ -145,14 +145,11 @@ Polymer({ |
| /** |
| * Handler for when the sync state is pushed from the browser. |
| + * @param {?settings.SyncStatus} syncStatus |
| * @private |
| */ |
| handleSyncStatus_: function(syncStatus) { |
| this.syncStatus = syncStatus; |
| - |
| - // TODO(tommycli): Remove once we figure out how to refactor the sync |
| - // code to not include HTML in the status messages. |
| - this.$.syncStatusText.innerHTML = syncStatus.statusText; |
| }, |
| <if expr="chromeos"> |
| @@ -207,6 +204,12 @@ Polymer({ |
| /** @private */ |
| onSyncTap_: function() { |
| + assert(this.syncStatus.signedIn); |
| + assert(this.syncStatus.syncSystemEnabled); |
| + |
| + if (this.syncStatus.managed) |
| + return; |
| + |
| this.$.pages.setSubpageChain(['sync']); |
| }, |
| @@ -234,18 +237,27 @@ Polymer({ |
| /** |
| * @private |
| + * @param {?settings.SyncStatus} syncStatus |
| * @return {boolean} |
| */ |
| - isStatusTextSet_: function(syncStatus) { |
| - return syncStatus && syncStatus.statusText.length > 0; |
| + isAdvancedSyncSettingsVisible_: function(syncStatus) { |
| + return !!syncStatus && !!syncStatus.signedIn && |
| + !!syncStatus.syncSystemEnabled; |
|
tommycli
2016/05/18 18:31:47
This was necessary to make the closure compiler ha
|
| }, |
| /** |
| * @private |
| - * @return {boolean} |
| + * @param {?settings.SyncStatus} syncStatus |
| + * @return {string} |
| */ |
| - isAdvancedSyncSettingsVisible_: function(syncStatus) { |
| - return syncStatus && syncStatus.signedIn && !syncStatus.managed && |
| - syncStatus.syncSystemEnabled; |
| + getSyncIcon_: function(syncStatus) { |
| + if (!syncStatus) |
| + return ''; |
| + if (syncStatus.hasError) |
| + return 'settings:sync-problem'; |
| + if (syncStatus.managed) |
| + return 'settings:sync-disabled'; |
| + |
| + return 'settings:done'; |
| }, |
| }); |