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