The Lock and Guest functions currently try to close all browser windows for...
The Lock and Guest functions currently try to close all browser windows for their profiles, and any OnBeforeUnload dialogs can cause that closing to fail. This CL takes inspiration from the BrowserCloseManager that is used when an entire browser window is closed. Methods are added to BrowserList that will trigger all OnBeforeUpload handlers, wait for the user's response, and then close the profile's browsers and perform an appropriate success callback. A abort callback is permitted and will be used when ProfileDeletion also uses this flow. Guest and Lock will now only open the User Manager (and lock the profile, for Lock) if no OnBeforeUnload event is canceled. BUG=368497, 289390 TEST=Open a guest profile. Navigate to http://www.4guysfromrolla.com/demos/OnBeforeUnloadDemo1.htm. Click "Exit Guest" in the User Menu. Select "Stay on this page". The window should stay open and the User Manager should not be shown. Open a signed-in and lockable profile. Navigate to the above URL. Lock the profile from the User Menu. Select "Stay on this page". The User Manager should not be shown. Manually opening the User Manager should show that the Profile has not been locked. Review URL: https://codereview.chromium.org/471763008 Cr-Commit-Position: refs/heads/master@{#293535}
Showing
Please register or sign in to comment