Chromium Code Reviews| 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(); |
| }, |