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

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

Issue 2239973002: MD Settings: Use dom-if for the profile disconnect dialog. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments. Created 3 years, 9 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 76115fddd4583d3a59b160bcc82c51c1338189b6..f548fff5ae9b22356b8a40c5810eef13c9d963d6 100644
--- a/chrome/browser/resources/settings/people_page/people_page.js
+++ b/chrome/browser/resources/settings/people_page/people_page.js
@@ -81,6 +81,9 @@ Polymer({
},
},
+ /** @private */
+ showDisconnectDialog_: Boolean,
+
// <if expr="chromeos">
/**
* True if quick unlock settings should be displayed on this machine.
@@ -184,12 +187,16 @@ Polymer({
// If the sync status has not been fetched yet, optimistically display
// the disconnect dialog. There is another check when the sync status is
// fetched. The dialog will be closed then the user is not signed in.
- if (this.syncStatus && !this.syncStatus.signedIn)
+ if (this.syncStatus && !this.syncStatus.signedIn) {
settings.navigateToPreviousRoute();
- else
- this.$.disconnectDialog.showModal();
- } else if (this.$.disconnectDialog.open) {
- this.$.disconnectDialog.close();
+ } else {
+ this.showDisconnectDialog_ = true;
+ this.async(function() {
+ this.$$('#disconnectDialog').showModal();
+ }.bind(this));
+ }
+ } else if (this.showDisconnectDialog_) {
+ this.$$('#disconnectDialog').close();
}
},
@@ -253,8 +260,8 @@ Polymer({
settings.ProfileInfoBrowserProxyImpl.getInstance().getProfileStatsCount();
// </if>
- if (!syncStatus.signedIn && this.$.disconnectDialog.open)
- this.$.disconnectDialog.close();
+ if (!syncStatus.signedIn && this.showDisconnectDialog_)
+ this.$$('#disconnectDialog').close();
this.syncStatus = syncStatus;
},
@@ -300,6 +307,7 @@ Polymer({
/** @private */
onDisconnectClosed_: function() {
+ this.showDisconnectDialog_ = false;
if (settings.getCurrentRoute() == settings.Route.SIGN_OUT)
settings.navigateToPreviousRoute();
this.fire('signout-dialog-closed');
@@ -312,7 +320,7 @@ Polymer({
/** @private */
onDisconnectCancel_: function() {
- this.$.disconnectDialog.close();
+ this.$$('#disconnectDialog').close();
},
/** @private */
@@ -328,7 +336,7 @@ Polymer({
this.syncBrowserProxy_.signOut(deleteProfile);
}.bind(this));
- this.$.disconnectDialog.close();
+ this.$$('#disconnectDialog').close();
},
/** @private */
« no previous file with comments | « chrome/browser/resources/settings/people_page/people_page.html ('k') | chrome/test/data/webui/settings/people_page_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698