Commit c6f63869 authored by Quan Nguyen's avatar Quan Nguyen Committed by Commit Bot

cros: Fix a views-login bug where clicking Add User too quickly could cause...

cros: Fix a views-login bug where clicking Add User too quickly could cause the Gaia screen not to load.

With this fix, clicking Add User very quickly will show a blank dialog
that gets filled in once the Gaia screen finishes initializing.

Bug: 837501
Change-Id: Ia87e4c20f80a08a739afc79f3978be11729db15d
Reviewed-on: https://chromium-review.googlesource.com/1147490Reviewed-by: default avatarJacob Dufault <jdufault@chromium.org>
Commit-Queue: Quan Nguyen <qnnguyen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#577311}
parent 16be2547
...@@ -259,8 +259,18 @@ void LoginDisplayHostMojo::ShowGaiaDialog( ...@@ -259,8 +259,18 @@ void LoginDisplayHostMojo::ShowGaiaDialog(
GetOobeUI()->GetGaiaScreenView()->ShowGaiaAsync(prefilled_account); GetOobeUI()->GetGaiaScreenView()->ShowGaiaAsync(prefilled_account);
LoadWallpaper(*prefilled_account); LoadWallpaper(*prefilled_account);
} else { } else {
if (GetOobeUI()->current_screen() != OobeScreen::SCREEN_GAIA_SIGNIN) // Two criteria here:
// 1) If we have started a wizard other than Gaia signin (signified by the
// current_screen() changing), we need to reload the Gaia screen, otherwise
// dialog_->Show() will show the wrong screen. 2) While login is being
// loaded in, the current_screen is UNKNOWN. During this time, the
// GaiaScreenView is initialized, after which ShowGaiaAsync() is called to
// load up the Gaia screen. If we try to ShowGaiaAsync() before this
// initialization is complete, the Gaia screen UI can crash and get stuck.
if (GetOobeUI()->current_screen() != OobeScreen::SCREEN_GAIA_SIGNIN &&
GetOobeUI()->current_screen() != OobeScreen::SCREEN_UNKNOWN) {
GetOobeUI()->GetGaiaScreenView()->ShowGaiaAsync(base::nullopt); GetOobeUI()->GetGaiaScreenView()->ShowGaiaAsync(base::nullopt);
}
LoadSigninWallpaper(); LoadSigninWallpaper();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment