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

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

Issue 2493573002: Make sure that the browser will always restore settings page instead of sign out page after user si… (Closed)
Patch Set: rebase from master Created 4 years, 1 month 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
« no previous file with comments | « no previous file | chrome/browser/sessions/session_common_utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 a2a61b843133325e1f3f45d0a87edd745be30545..ec625426fa28a93ab8a9f65fc7dc1c04505b9482 100644
--- a/chrome/browser/resources/settings/people_page/people_page.js
+++ b/chrome/browser/resources/settings/people_page/people_page.js
@@ -231,6 +231,7 @@ Polymer({
onDisconnectClosed_: function() {
if (settings.getCurrentRoute() == settings.Route.SIGN_OUT)
settings.navigateToPreviousRoute();
+ this.fire('signout-dialog-closed');
},
/** @private */
@@ -247,7 +248,15 @@ Polymer({
onDisconnectConfirm_: function() {
var deleteProfile = !!this.syncStatus.domain ||
(this.$.deleteProfile && this.$.deleteProfile.checked);
- this.syncBrowserProxy_.signOut(deleteProfile);
+ // Trigger the sign out event after the navigateToPreviousRoute().
+ // So that the navigation to the setting page could be finished before the
+ // sign out if navigateToPreviousRoute() returns synchronously even the
+ // browser is closed after the sign out. Otherwise, the navigation will be
+ // finshed during session restore if the browser is closed before the async
+ // callback executed.
+ listenOnce(this, 'signout-dialog-closed', function() {
+ this.syncBrowserProxy_.signOut(deleteProfile);
+ }.bind(this));
this.$.disconnectDialog.close();
},
« no previous file with comments | « no previous file | chrome/browser/sessions/session_common_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698