Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3000)

Unified Diff: chrome/browser/resources/settings/people_page/people_page.js

Issue 1984313003: Settings People Revamp: Update main card Sync 'look' to match new spec. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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';
},
});

Powered by Google App Engine
This is Rietveld 408576698