Commit 14fd238a authored by Quan Nguyen's avatar Quan Nguyen Committed by Commit Bot

Revert "Enable powerwash shortcut in views-based login screen."

This reverts commit 8db5d9a3.

Reason for revert: This CL was identified as introducing flakiness to LoginCursorTest.CursorHidden (in interactive_ui_tests)

Original change's description:
> Enable powerwash shortcut in views-based login screen.
> 
> Bug: 837501
> Cq-Include-Trybots: luci.chromium.try:closure_compilation
> Change-Id: Ia55c5e302d70c1a65409fd7268ae135e0ee7c5ca
> Reviewed-on: https://chromium-review.googlesource.com/1102904
> Commit-Queue: Quan Nguyen <qnnguyen@chromium.org>
> Reviewed-by: Jacob Dufault <jdufault@chromium.org>
> Reviewed-by: Xiyuan Xia <xiyuan@chromium.org>
> Reviewed-by: Daniel Cheng <dcheng@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#569043}

TBR=xiyuan@chromium.org,dcheng@chromium.org,jdufault@chromium.org,qnnguyen@chromium.org

Change-Id: I2cf2fcc2d8a0f8c491b16e4bca4387e07cabb69c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 837501
Cq-Include-Trybots: luci.chromium.try:closure_compilation
Reviewed-on: https://chromium-review.googlesource.com/1109617
Commit-Queue: Xiyuan Xia <xiyuan@chromium.org>
Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#569252}
parent 30aa8e9c
...@@ -193,12 +193,6 @@ void LoginScreenController::ShowGaiaSignin( ...@@ -193,12 +193,6 @@ void LoginScreenController::ShowGaiaSignin(
login_screen_client_->ShowGaiaSignin(can_close, prefilled_account); login_screen_client_->ShowGaiaSignin(can_close, prefilled_account);
} }
void LoginScreenController::ShowResetScreen() {
if (!login_screen_client_)
return;
login_screen_client_->ShowResetScreen();
}
void LoginScreenController::OnRemoveUserWarningShown() { void LoginScreenController::OnRemoveUserWarningShown() {
if (!login_screen_client_) if (!login_screen_client_)
return; return;
......
...@@ -71,7 +71,6 @@ class ASH_EXPORT LoginScreenController : public mojom::LoginScreen { ...@@ -71,7 +71,6 @@ class ASH_EXPORT LoginScreenController : public mojom::LoginScreen {
void FocusLockScreenApps(bool reverse); void FocusLockScreenApps(bool reverse);
void ShowGaiaSignin(bool can_close, void ShowGaiaSignin(bool can_close,
const base::Optional<AccountId>& prefilled_account); const base::Optional<AccountId>& prefilled_account);
void ShowResetScreen();
void OnRemoveUserWarningShown(); void OnRemoveUserWarningShown();
void RemoveUser(const AccountId& account_id); void RemoveUser(const AccountId& account_id);
void LaunchPublicSession(const AccountId& account_id, void LaunchPublicSession(const AccountId& account_id,
......
...@@ -69,7 +69,6 @@ class MockLoginScreenClient : public mojom::LoginScreenClient { ...@@ -69,7 +69,6 @@ class MockLoginScreenClient : public mojom::LoginScreenClient {
void(const AccountId& account_id, const std::string& locale)); void(const AccountId& account_id, const std::string& locale));
MOCK_METHOD0(ShowFeedback, void()); MOCK_METHOD0(ShowFeedback, void());
MOCK_METHOD1(LaunchKioskApp, void(const std::string& app_id)); MOCK_METHOD1(LaunchKioskApp, void(const std::string& app_id));
MOCK_METHOD0(ShowResetScreen, void());
private: private:
bool authenticate_user_callback_result_ = true; bool authenticate_user_callback_result_ = true;
......
...@@ -38,13 +38,10 @@ ...@@ -38,13 +38,10 @@
#include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/dbus_thread_manager.h"
#include "components/user_manager/user_type.h" #include "components/user_manager/user_type.h"
#include "ui/accessibility/ax_node_data.h" #include "ui/accessibility/ax_node_data.h"
#include "ui/base/accelerators/accelerator.h"
#include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/l10n_util.h"
#include "ui/display/display.h" #include "ui/display/display.h"
#include "ui/display/manager/display_manager.h" #include "ui/display/manager/display_manager.h"
#include "ui/display/manager/managed_display_info.h" #include "ui/display/manager/managed_display_info.h"
#include "ui/events/event_constants.h"
#include "ui/events/keycodes/keyboard_codes.h"
#include "ui/gfx/geometry/insets.h" #include "ui/gfx/geometry/insets.h"
#include "ui/gfx/geometry/rect.h" #include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/size.h" #include "ui/gfx/geometry/size.h"
...@@ -1341,9 +1338,6 @@ void LockContentsView::RegisterAccelerators() { ...@@ -1341,9 +1338,6 @@ void LockContentsView::RegisterAccelerators() {
// TODO: Add more accelerators that are applicable to login screen. // TODO: Add more accelerators that are applicable to login screen.
accel_map_[ui::Accelerator(ui::VKEY_I, ui::EF_SHIFT_DOWN | ui::EF_ALT_DOWN)] = accel_map_[ui::Accelerator(ui::VKEY_I, ui::EF_SHIFT_DOWN | ui::EF_ALT_DOWN)] =
AcceleratorAction::kShowFeedback; AcceleratorAction::kShowFeedback;
accel_map_[ui::Accelerator(
ui::VKEY_R, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN)] =
AcceleratorAction::kShowReset;
AcceleratorController* controller = Shell::Get()->accelerator_controller(); AcceleratorController* controller = Shell::Get()->accelerator_controller();
for (const auto& item : accel_map_) for (const auto& item : accel_map_)
...@@ -1355,9 +1349,6 @@ void LockContentsView::PerformAction(AcceleratorAction action) { ...@@ -1355,9 +1349,6 @@ void LockContentsView::PerformAction(AcceleratorAction action) {
case AcceleratorAction::kShowFeedback: case AcceleratorAction::kShowFeedback:
Shell::Get()->login_screen_controller()->ShowFeedback(); Shell::Get()->login_screen_controller()->ShowFeedback();
return; return;
case AcceleratorAction::kShowReset:
Shell::Get()->login_screen_controller()->ShowResetScreen();
return;
default: default:
NOTREACHED(); NOTREACHED();
} }
......
...@@ -102,7 +102,6 @@ class ASH_EXPORT LockContentsView ...@@ -102,7 +102,6 @@ class ASH_EXPORT LockContentsView
enum class AcceleratorAction { enum class AcceleratorAction {
kShowFeedback, kShowFeedback,
kShowReset,
}; };
// Number of login attempts before a login dialog is shown. For example, if // Number of login attempts before a login dialog is shown. For example, if
......
...@@ -194,9 +194,6 @@ interface LoginScreenClient { ...@@ -194,9 +194,6 @@ interface LoginScreenClient {
// sign-in dialog so the user does not need to type the account email. // sign-in dialog so the user does not need to type the account email.
ShowGaiaSignin(bool can_close, signin.mojom.AccountId? prefilled_account); ShowGaiaSignin(bool can_close, signin.mojom.AccountId? prefilled_account);
// Show the Reset (Powerwash) screen.
ShowResetScreen();
// Notification that the remove user warning was shown. // Notification that the remove user warning was shown.
OnRemoveUserWarningShown(); OnRemoveUserWarningShown();
......
...@@ -360,10 +360,6 @@ void UserSelectionScreen::InitEasyUnlock() { ...@@ -360,10 +360,6 @@ void UserSelectionScreen::InitEasyUnlock() {
proximity_auth::ScreenlockBridge::Get()->SetLockHandler(this); proximity_auth::ScreenlockBridge::Get()->SetLockHandler(this);
} }
bool UserSelectionScreen::HasAnyUsers() const {
return !users_.empty();
}
// static // static
void UserSelectionScreen::FillUserDictionary( void UserSelectionScreen::FillUserDictionary(
user_manager::User* user, user_manager::User* user,
......
...@@ -65,12 +65,11 @@ class UserSelectionScreen ...@@ -65,12 +65,11 @@ class UserSelectionScreen
void AttemptEasyUnlock(const AccountId& account_id); void AttemptEasyUnlock(const AccountId& account_id);
void RecordClickOnLockIcon(const AccountId& account_id); void RecordClickOnLockIcon(const AccountId& account_id);
void InitEasyUnlock();
bool HasAnyUsers() const;
// ui::UserActivityDetector implementation: // ui::UserActivityDetector implementation:
void OnUserActivity(const ui::Event* event) override; void OnUserActivity(const ui::Event* event) override;
void InitEasyUnlock();
// proximity_auth::ScreenlockBridge::LockHandler implementation: // proximity_auth::ScreenlockBridge::LockHandler implementation:
void ShowBannerMessage(const base::string16& message, void ShowBannerMessage(const base::string16& message,
bool is_warning) override; bool is_warning) override;
......
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
#include <string> #include <string>
#include <utility> #include <utility>
#include "base/optional.h"
#include "base/threading/thread_task_runner_handle.h" #include "base/threading/thread_task_runner_handle.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_version_info_dispatcher.h" #include "chrome/browser/chromeos/login/mojo_version_info_dispatcher.h"
...@@ -138,15 +137,13 @@ void LoginDisplayHostMojo::StartWizard(OobeScreen first_screen) { ...@@ -138,15 +137,13 @@ void LoginDisplayHostMojo::StartWizard(OobeScreen first_screen) {
DCHECK(GetOobeUI()); DCHECK(GetOobeUI());
// Dtor of the old WizardController should be called before ctor of the // Dtor of the old WizardController should be called before ctor of the
// new one to ensure only one |WizardController| instance at a time. // new one to ensure only one |ExistingUserController| instance at a time.
wizard_controller_.reset(); wizard_controller_.reset();
wizard_controller_.reset(new WizardController(this, GetOobeUI())); wizard_controller_.reset(new WizardController(this, GetOobeUI()));
wizard_controller_->Init(first_screen); wizard_controller_->Init(first_screen);
bool closable_by_esc = first_screen == OobeScreen::SCREEN_OOBE_RESET;
// Post login screens should not be closable by escape key. // Post login screens should not be closable by escape key.
dialog_->Show(closable_by_esc); dialog_->Show(false /*closable_by_esc*/);
} }
WizardController* LoginDisplayHostMojo::GetWizardController() { WizardController* LoginDisplayHostMojo::GetWizardController() {
...@@ -174,20 +171,6 @@ void LoginDisplayHostMojo::OnStartSignInScreen( ...@@ -174,20 +171,6 @@ void LoginDisplayHostMojo::OnStartSignInScreen(
return; return;
} }
// If signin_screen_started_, we already have an instance of LockScreen,
// so we can skip login screen initialization and just reset the dialog state.
if (signin_screen_started_) {
if (user_selection_screen_->HasAnyUsers()) {
dialog_->Hide();
} else {
GetOobeUI()->GetGaiaScreenView()->ShowGaiaAsync(base::nullopt);
dialog_->Show(false /*closable_by_esc*/);
}
return;
}
signin_screen_started_ = true;
// There can only be one |ExistingUserController| instance at a time. // There can only be one |ExistingUserController| instance at a time.
existing_user_controller_.reset(); existing_user_controller_.reset();
existing_user_controller_ = std::make_unique<ExistingUserController>(this); existing_user_controller_ = std::make_unique<ExistingUserController>(this);
...@@ -239,11 +222,13 @@ void LoginDisplayHostMojo::UpdateGaiaDialogVisibility( ...@@ -239,11 +222,13 @@ void LoginDisplayHostMojo::UpdateGaiaDialogVisibility(
DCHECK(dialog_); DCHECK(dialog_);
if (visible) { if (visible) {
GetOobeUI()->GetGaiaScreenView()->ShowGaiaAsync(prefilled_account); if (prefilled_account) {
if (prefilled_account) // Make sure gaia displays |account| if requested.
GetOobeUI()->GetGaiaScreenView()->ShowGaiaAsync(prefilled_account);
LoginDisplayHost::default_host()->LoadWallpaper(*prefilled_account); LoginDisplayHost::default_host()->LoadWallpaper(*prefilled_account);
else } else {
LoginDisplayHost::default_host()->LoadSigninWallpaper(); LoginDisplayHost::default_host()->LoadSigninWallpaper();
}
dialog_->Show(can_close /*closable_by_esc*/); dialog_->Show(can_close /*closable_by_esc*/);
return; return;
......
...@@ -144,8 +144,6 @@ class LoginDisplayHostMojo : public LoginDisplayHostCommon, ...@@ -144,8 +144,6 @@ class LoginDisplayHostMojo : public LoginDisplayHostCommon,
// Updates UI when version info is changed. // Updates UI when version info is changed.
std::unique_ptr<MojoVersionInfoDispatcher> version_info_updater_; std::unique_ptr<MojoVersionInfoDispatcher> version_info_updater_;
bool signin_screen_started_ = false;
base::WeakPtrFactory<LoginDisplayHostMojo> weak_factory_; base::WeakPtrFactory<LoginDisplayHostMojo> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(LoginDisplayHostMojo); DISALLOW_COPY_AND_ASSIGN(LoginDisplayHostMojo);
......
...@@ -68,6 +68,9 @@ cr.define('cr.ui.Oobe', function() { ...@@ -68,6 +68,9 @@ cr.define('cr.ui.Oobe', function() {
login.TopHeaderBar.decorate($('top-header-bar')); login.TopHeaderBar.decorate($('top-header-bar'));
chrome.send('screenStateInitialize'); chrome.send('screenStateInitialize');
if (Oobe.getInstance().showingViewsLogin)
chrome.send('showAddUser');
}, },
// Dummy Oobe functions not present with stripped login UI. // Dummy Oobe functions not present with stripped login UI.
......
...@@ -118,13 +118,6 @@ void LoginScreenClient::ShowGaiaSignin( ...@@ -118,13 +118,6 @@ void LoginScreenClient::ShowGaiaSignin(
} }
} }
void LoginScreenClient::ShowResetScreen() {
if (chromeos::LoginDisplayHost::default_host()) {
chromeos::LoginDisplayHost::default_host()->StartWizard(
chromeos::OobeScreen::SCREEN_OOBE_RESET);
}
}
void LoginScreenClient::OnRemoveUserWarningShown() { void LoginScreenClient::OnRemoveUserWarningShown() {
ProfileMetrics::LogProfileDeleteUser( ProfileMetrics::LogProfileDeleteUser(
ProfileMetrics::DELETE_PROFILE_USER_MANAGER_SHOW_WARNING); ProfileMetrics::DELETE_PROFILE_USER_MANAGER_SHOW_WARNING);
......
...@@ -75,7 +75,6 @@ class LoginScreenClient : public ash::mojom::LoginScreenClient { ...@@ -75,7 +75,6 @@ class LoginScreenClient : public ash::mojom::LoginScreenClient {
void ShowGaiaSignin( void ShowGaiaSignin(
bool can_close, bool can_close,
const base::Optional<AccountId>& prefilled_account) override; const base::Optional<AccountId>& prefilled_account) override;
void ShowResetScreen() override;
void OnRemoveUserWarningShown() override; void OnRemoveUserWarningShown() override;
void RemoveUser(const AccountId& account_id) override; void RemoveUser(const AccountId& account_id) override;
void LaunchPublicSession(const AccountId& account_id, void LaunchPublicSession(const AccountId& account_id,
......
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