Commit e49cddab authored by Jacob Dufault's avatar Jacob Dufault Committed by Commit Bot

cros: Rework LoginDisplayHostMojo::UpdateGaiaDialogVisibility

- drop LoginDisplayHost::default_host(), we're already in the default_host()
  instance
- remove early-return
- check if we're currently signing in, in which case do not show gaia (fixes the
  bug)

Bug: 852745
Change-Id: I5e1e7dcfca2c7aca55b9301721ea3499c1a88451
Reviewed-on: https://chromium-review.googlesource.com/1110273Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Commit-Queue: Jacob Dufault <jdufault@chromium.org>
Cr-Commit-Position: refs/heads/master@{#569771}
parent a7643e7c
......@@ -227,29 +227,35 @@ void LoginDisplayHostMojo::UpdateGaiaDialogVisibility(
const base::Optional<AccountId>& prefilled_account) {
DCHECK(dialog_);
bool is_signing_in = login_display_->IsSigninInProgress();
if (visible) {
// Show the dialog.
if (prefilled_account) {
// Make sure gaia displays |account| if requested.
GetOobeUI()->GetGaiaScreenView()->ShowGaiaAsync(prefilled_account);
LoginDisplayHost::default_host()->LoadWallpaper(*prefilled_account);
if (!is_signing_in)
GetOobeUI()->GetGaiaScreenView()->ShowGaiaAsync(prefilled_account);
LoadWallpaper(*prefilled_account);
} else {
LoginDisplayHost::default_host()->LoadSigninWallpaper();
LoadSigninWallpaper();
}
dialog_->Show(can_close /*closable_by_esc*/);
return;
}
// Show the wallpaper of the focused user pod when the dialog is hidden.
LoginDisplayHost::default_host()->LoadWallpaper(focused_pod_account_id_);
} else {
// Hide the dialog.
if (users_.empty() && GetOobeUI()) {
// The dialog can not be closed if there is no user on the login screen.
// Refresh the dialog instead.
GetOobeUI()->GetGaiaScreenView()->ShowGaiaAsync(base::nullopt);
return;
}
if (!is_signing_in && users_.empty() && GetOobeUI()) {
GetOobeUI()->GetGaiaScreenView()->ShowGaiaAsync(base::nullopt);
return;
}
dialog_->Hide();
LoadWallpaper(focused_pod_account_id_);
dialog_->Hide();
}
}
void LoginDisplayHostMojo::UpdateGaiaDialogSize(int width, int height) {
......
......@@ -6,7 +6,6 @@
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/chromeos/accessibility/accessibility_manager.h"
#include "chrome/browser/chromeos/login/existing_user_controller.h"
#include "chrome/browser/chromeos/login/screens/chrome_user_selection_screen.h"
#include "chrome/browser/chromeos/login/screens/user_selection_screen.h"
#include "chrome/browser/chromeos/login/ui/login_display_host_mojo.h"
......@@ -152,12 +151,13 @@ void LoginDisplayMojo::ShowUnrecoverableCrypthomeErrorDialog() {
void LoginDisplayMojo::Login(const UserContext& user_context,
const SigninSpecifics& specifics) {
if (host_)
host_->existing_user_controller()->Login(user_context, specifics);
if (delegate_)
delegate_->Login(user_context, specifics);
}
bool LoginDisplayMojo::IsSigninInProgress() const {
NOTIMPLEMENTED();
if (delegate_)
return delegate_->IsSigninInProgress();
return false;
}
......@@ -232,8 +232,7 @@ bool LoginDisplayMojo::AllowNewUserChanged() const {
}
bool LoginDisplayMojo::IsUserSigninCompleted() const {
NOTIMPLEMENTED();
return false;
return is_signin_completed();
}
void LoginDisplayMojo::HandleGetUsers() {
......
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