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

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

Issue 2230833003: MD Settings: Remove iron-pages usage from <settings-sync-page>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nit Created 4 years, 4 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/sync_page.js
diff --git a/chrome/browser/resources/settings/people_page/sync_page.js b/chrome/browser/resources/settings/people_page/sync_page.js
index 0ef62fb65a4b27577a47e0f0ebe1a00b11cb040b..0d9a738b4148e65b8babd4f8aa923f8b2425cfe3 100644
--- a/chrome/browser/resources/settings/people_page/sync_page.js
+++ b/chrome/browser/resources/settings/people_page/sync_page.js
@@ -61,12 +61,14 @@ Polymer({
},
/**
- * The curerntly displayed page.
+ * The current page status. Defaults to |CONFIGURE| such that the searching
+ * algorithm can search useful content when the page is not visible to the
+ * user.
* @private {?settings.PageStatus}
*/
- selectedPage_: {
+ pageStatus_: {
type: String,
- value: settings.PageStatus.SPINNER,
+ value: settings.PageStatus.CONFIGURE,
},
/**
@@ -145,6 +147,15 @@ Polymer({
this.onNavigateAwayFromPage_();
},
+ /**
+ * @param {!settings.PageStatus} expectedPageStatus
+ * @return {boolean}
+ * @private
+ */
+ isStatus_: function(expectedPageStatus) {
+ return expectedPageStatus == this.pageStatus_;
+ },
+
/** @private */
onNavigateToPage_: function() {
// The element is not ready for C++ interaction until it is attached.
@@ -155,7 +166,7 @@ Polymer({
return;
// Display loading page until the settings have been retrieved.
- this.selectedPage_ = settings.PageStatus.SPINNER;
+ this.pageStatus_ = settings.PageStatus.SPINNER;
this.browserProxy_.didNavigateToSyncPage();
@@ -168,6 +179,10 @@ Polymer({
if (!this.unloadCallback_)
return;
+ // Reset the status to CONFIGURE such that the searching algorithm can
+ // search useful content when the page is not visible to the user.
+ this.pageStatus_ = settings.PageStatus.CONFIGURE;
+
this.browserProxy_.didNavigateAwayFromSyncPage();
window.removeEventListener('unload', this.unloadCallback_);
@@ -180,7 +195,7 @@ Polymer({
*/
handleSyncPrefsChanged_: function(syncPrefs) {
this.syncPrefs = syncPrefs;
- this.selectedPage_ = settings.PageStatus.CONFIGURE;
+ this.pageStatus_ = settings.PageStatus.CONFIGURE;
// If autofill is not registered or synced, force Payments integration off.
if (!this.syncPrefs.autofillRegistered || !this.syncPrefs.autofillSynced)
@@ -291,14 +306,14 @@ Polymer({
case settings.PageStatus.SPINNER:
case settings.PageStatus.TIMEOUT:
case settings.PageStatus.CONFIGURE:
- this.selectedPage_ = pageStatus;
+ this.pageStatus_ = pageStatus;
return;
case settings.PageStatus.DONE:
if (settings.getCurrentRoute() == settings.Route.SYNC)
settings.navigateTo(settings.Route.PEOPLE);
return;
case settings.PageStatus.PASSPHRASE_FAILED:
- if (this.selectedPage_ == this.pages.CONFIGURE &&
+ if (this.pageStatus_ == this.pages.CONFIGURE &&
this.syncPrefs && this.syncPrefs.passphraseRequired) {
this.$$('#existingPassphraseInput').invalid = true;
}

Powered by Google App Engine
This is Rietveld 408576698