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

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: append the missing file 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
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..8c247d9a3651c2c53c3de6c718196a87ca336e31 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.dispatchEvent(new Event('signout-dialog-closed'));
sky 2016/11/11 00:32:17 I'm not a good reviewer for the changes to this fi
Dan Beam 2016/11/11 01:56:46 this.fire('signout-dialog-closed');
zmin 2016/11/11 22:54:01 Done.
},
/** @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 callback() {
Dan Beam 2016/11/11 01:56:46 no need to name this "callback", just: listenOnce
zmin 2016/11/11 22:54:01 Remove callback and, no it can't listen this even
+ 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') | chrome/browser/sessions/session_common_utils.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698