Commit 7d98b2a0 authored by Toni Barzic's avatar Toni Barzic Committed by Commit Bot

Fix powerwash flow for views base login

Check for showing powerwash and enable debugging dialogs on boot
were only handled in response to signin screen loads from web UI login
implementation (on gaia screen load, and account picker load).

This replaces check during account picker show with a check in login
display host mojo, just before the login display view is initialized.
(The account picker web UI is not generally expected to show on
startup).

BUG=944345

Change-Id: I1fa41fb64a3ba8c900e29695f47277c679581471
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1554830
Commit-Queue: Toni Baržić <tbarzic@chromium.org>
Reviewed-by: default avatarJacob Dufault <jdufault@chromium.org>
Cr-Commit-Position: refs/heads/master@{#648297}
parent d285bff6
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include "base/bind.h" #include "base/bind.h"
#include "base/threading/thread_task_runner_handle.h" #include "base/threading/thread_task_runner_handle.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chromeos/login/existing_user_controller.h" #include "chrome/browser/chromeos/login/existing_user_controller.h"
#include "chrome/browser/chromeos/login/mojo_system_info_dispatcher.h" #include "chrome/browser/chromeos/login/mojo_system_info_dispatcher.h"
#include "chrome/browser/chromeos/login/screens/chrome_user_selection_screen.h" #include "chrome/browser/chromeos/login/screens/chrome_user_selection_screen.h"
...@@ -20,6 +21,7 @@ ...@@ -20,6 +21,7 @@
#include "chrome/browser/ui/ash/login_screen_client.h" #include "chrome/browser/ui/ash/login_screen_client.h"
#include "chrome/browser/ui/ash/wallpaper_controller_client.h" #include "chrome/browser/ui/ash/wallpaper_controller_client.h"
#include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" #include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h"
#include "chrome/common/pref_names.h"
#include "chromeos/login/auth/user_context.h" #include "chromeos/login/auth/user_context.h"
#include "components/user_manager/user_names.h" #include "components/user_manager/user_names.h"
...@@ -200,6 +202,35 @@ void LoginDisplayHostMojo::OnStartSignInScreen( ...@@ -200,6 +202,35 @@ void LoginDisplayHostMojo::OnStartSignInScreen(
return; return;
} }
// Check whether factory reset or debugging feature have been requested in
// prior session. Ideally this would be handled earlier in startup flow, but
// it's handled here, after mojo login display host is set up to avoid running
// the wizard with web UI based login display host, and possibly adding
// another way to land on web UI based sign-in screen.
// TODO(tbarzic): Reassess when https://crbug.com/943720 is fixed.
PrefService* local_state = g_browser_process->local_state();
if (local_state->GetBoolean(prefs::kFactoryResetRequested)) {
StartWizard(OobeScreen::SCREEN_OOBE_RESET);
start_delayed_for_oobe_dialog_ = true;
return;
}
if (local_state->GetBoolean(prefs::kDebuggingFeaturesRequested)) {
StartWizard(OobeScreen::SCREEN_OOBE_ENABLE_DEBUGGING);
start_delayed_for_oobe_dialog_ = true;
return;
}
// If initial signin screen was delayed to show a OOBE dialog, make sure the
// dialog is hidden.
if (start_delayed_for_oobe_dialog_) {
dialog_->Hide();
// Reset accelerator will not work properly if OOBE UI stays in reset
// dialog state, so make sure the curren dialog screen changes.
GetOobeUI()->GetGaiaScreenView()->ShowGaiaAsync(base::nullopt);
start_delayed_for_oobe_dialog_ = false;
}
signin_screen_started_ = true; signin_screen_started_ = true;
existing_user_controller_ = std::make_unique<ExistingUserController>(); existing_user_controller_ = std::make_unique<ExistingUserController>();
......
...@@ -164,6 +164,10 @@ class LoginDisplayHostMojo : public LoginDisplayHostCommon, ...@@ -164,6 +164,10 @@ class LoginDisplayHostMojo : public LoginDisplayHostCommon,
// first OnStartSigninScreen and remains true afterward. // first OnStartSigninScreen and remains true afterward.
bool signin_screen_started_ = false; bool signin_screen_started_ = false;
// Set if the signin screen initialization was delayed to show a OOBE dialog,
// for example to run reset or enable debugging wizard.
bool start_delayed_for_oobe_dialog_ = false;
base::WeakPtrFactory<LoginDisplayHostMojo> weak_factory_; base::WeakPtrFactory<LoginDisplayHostMojo> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(LoginDisplayHostMojo); DISALLOW_COPY_AND_ASSIGN(LoginDisplayHostMojo);
......
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