Commit e82f5356 authored by Roman Sorokin's avatar Roman Sorokin Committed by Commit Bot

cros: Cleanup LoginDisplay a bit

Removed unused bits, inlined some of the code.

Bug: 1067260
Change-Id: I1e5be13ba9bc89f5ec1fa24e90652e4992c462f6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2279804
Commit-Queue: Roman Sorokin [CET] <rsorokin@chromium.org>
Reviewed-by: default avatarRoman Aleksandrov <raleksandrov@google.com>
Cr-Commit-Position: refs/heads/master@{#785818}
parent 1bb72b7e
......@@ -138,10 +138,6 @@ bool AppLaunchSigninScreen::IsUserSigninCompleted() const {
return false;
}
void AppLaunchSigninScreen::Signout() {
NOTREACHED();
}
void AppLaunchSigninScreen::OnAuthFailure(const AuthFailure& error) {
LOG(ERROR) << "Unlock failure: " << error.reason();
webui_handler_->ClearAndEnablePassword();
......
......@@ -69,7 +69,6 @@ class AppLaunchSigninScreen : public SigninScreenHandlerDelegate,
bool AllowNewUserChanged() const override;
bool IsSigninInProgress() const override;
bool IsUserSigninCompleted() const override;
void Signout() override;
void HandleGetUsers() override;
void CheckUserStatus(const AccountId& account_id) override;
......
......@@ -78,7 +78,6 @@
#include "chrome/browser/ui/webui/chromeos/login/l10n_util.h"
#include "chrome/browser/ui/webui/chromeos/login/tpm_error_screen_handler.h"
#include "chrome/browser/ui/webui/chromeos/login/update_required_screen_handler.h"
#include "chrome/browser/ui/webui/chromeos/login/wrong_hwid_screen_handler.h"
#include "chrome/common/channel_info.h"
#include "chrome/common/chrome_features.h"
#include "chrome/common/chrome_switches.h"
......@@ -566,7 +565,6 @@ void ExistingUserController::UpdateLoginDisplay(
show_users_on_signin |= !filtered_users.empty();
bool allow_new_user = true;
cros_settings_->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user);
GetLoginDisplay()->set_parent_window(GetNativeWindow());
GetLoginDisplay()->Init(filtered_users, show_guest, show_users_on_signin,
allow_new_user);
GetLoginDisplayHost()->OnPreferencesChanged();
......@@ -870,18 +868,6 @@ void ExistingUserController::SetDisplayAndGivenName(
given_name_ = base::UTF8ToUTF16(given_name);
}
void ExistingUserController::ShowWrongHWIDScreen() {
GetLoginDisplayHost()->StartWizard(WrongHWIDScreenView::kScreenId);
}
void ExistingUserController::ShowUpdateRequiredScreen() {
GetLoginDisplayHost()->StartWizard(UpdateRequiredView::kScreenId);
}
void ExistingUserController::Signout() {
NOTREACHED();
}
bool ExistingUserController::IsUserWhitelisted(const AccountId& account_id) {
bool wildcard_match = false;
if (login_performer_.get())
......@@ -1610,7 +1596,7 @@ void ExistingUserController::ConfigureAutoLogin() {
if (show_update_required_screen) {
// Update required screen overrides public session auto login.
StopAutoLoginTimer();
ShowUpdateRequiredScreen();
GetLoginDisplayHost()->StartWizard(UpdateRequiredView::kScreenId);
} else if (public_session_auto_login_account_id_.is_valid()) {
StartAutoLoginTimer();
} else {
......
......@@ -111,9 +111,6 @@ class ExistingUserController : public LoginDisplay::Delegate,
void OnStartKioskEnableScreen() override;
void OnStartKioskAutolaunchScreen() override;
void ResetAutoLoginTimer() override;
void ShowWrongHWIDScreen() override;
void ShowUpdateRequiredScreen() override;
void Signout() override;
void CompleteLogin(const UserContext& user_context);
void OnGaiaScreenReady();
......
......@@ -168,9 +168,6 @@ class ExistingUserControllerTest : public policy::DevicePolicyCrosBrowserTest {
EXPECT_CALL(*mock_login_display_host_, GetLoginDisplay())
.Times(AnyNumber())
.WillRepeatedly(Return(mock_login_display_.get()));
EXPECT_CALL(*mock_login_display_host_, GetNativeWindow())
.Times(1)
.WillOnce(ReturnNull());
EXPECT_CALL(*mock_login_display_host_, OnPreferencesChanged()).Times(1);
EXPECT_CALL(*mock_login_display_, Init(_, true, true, true)).Times(1);
}
......@@ -391,9 +388,6 @@ class ExistingUserControllerPublicSessionTest
EXPECT_CALL(*mock_login_display_host_, GetLoginDisplay())
.Times(AnyNumber())
.WillRepeatedly(Return(mock_login_display_.get()));
EXPECT_CALL(*mock_login_display_host_.get(), GetNativeWindow())
.Times(AnyNumber())
.WillRepeatedly(ReturnNull());
EXPECT_CALL(*mock_login_display_host_.get(), OnPreferencesChanged())
.Times(AnyNumber());
EXPECT_CALL(*mock_login_display_, Init(_, _, _, _)).Times(AnyNumber());
......@@ -867,9 +861,6 @@ class ExistingUserControllerActiveDirectoryUserWhitelistTest
EXPECT_CALL(*mock_login_display_host_, GetLoginDisplay())
.Times(AnyNumber())
.WillRepeatedly(Return(mock_login_display_.get()));
EXPECT_CALL(*mock_login_display_host_, GetNativeWindow())
.Times(1)
.WillOnce(ReturnNull());
EXPECT_CALL(*mock_login_display_host_, OnPreferencesChanged()).Times(1);
EXPECT_CALL(*mock_login_display_, Init(_, true, true, false)).Times(1);
}
......
......@@ -37,10 +37,6 @@ class LoginDisplay {
// Returns true if sign in is in progress.
virtual bool IsSigninInProgress() const = 0;
// Sign out the currently signed in user.
// Used when the lock screen is being displayed.
virtual void Signout() = 0;
// Notify the delegate when the sign-in UI is finished loading.
virtual void OnSigninScreenReady() = 0;
......@@ -56,12 +52,6 @@ class LoginDisplay {
// Called when the owner permission for kiosk app auto launch is requested.
virtual void OnStartKioskAutolaunchScreen() = 0;
// Shows update required screen.
virtual void ShowUpdateRequiredScreen() = 0;
// Shows wrong HWID screen.
virtual void ShowWrongHWIDScreen() = 0;
// Returns name of the currently connected network, for error message,
virtual base::string16 GetConnectedNetworkName() = 0;
......@@ -114,9 +104,6 @@ class LoginDisplay {
Delegate* delegate() { return delegate_; }
void set_delegate(Delegate* delegate) { delegate_ = delegate; }
gfx::NativeWindow parent_window() const { return parent_window_; }
void set_parent_window(gfx::NativeWindow window) { parent_window_ = window; }
bool is_signin_completed() const { return is_signin_completed_; }
void set_signin_completed(bool value) { is_signin_completed_ = value; }
......@@ -124,9 +111,6 @@ class LoginDisplay {
// Login UI delegate (controller).
Delegate* delegate_ = nullptr;
// Parent window, might be used to create dialog windows.
gfx::NativeWindow parent_window_ = nullptr;
// True if signin for user has completed.
// TODO(nkostylev): Find a better place to store this state
// in redesigned login stack.
......
......@@ -216,10 +216,6 @@ bool LoginDisplayMojo::IsSigninInProgress() const {
return false;
}
void LoginDisplayMojo::Signout() {
NOTIMPLEMENTED();
}
void LoginDisplayMojo::OnSigninScreenReady() {
if (delegate_)
delegate_->OnSigninScreenReady();
......
......@@ -51,7 +51,6 @@ class LoginDisplayMojo : public LoginDisplay,
void Login(const UserContext& user_context,
const SigninSpecifics& specifics) override;
bool IsSigninInProgress() const override;
void Signout() override;
void OnSigninScreenReady() override;
void ShowEnterpriseEnrollmentScreen() override;
void ShowEnableDebuggingScreen() override;
......
......@@ -15,7 +15,9 @@
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.h"
#include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h"
#include "chrome/browser/ui/webui/chromeos/login/update_required_screen_handler.h"
#include "chrome/browser/ui/webui/chromeos/login/user_board_screen_handler.h"
#include "chrome/browser/ui/webui/chromeos/login/wrong_hwid_screen_handler.h"
#include "chrome/grit/generated_resources.h"
#include "components/account_id/account_id.h"
#include "components/strings/grit/components_strings.h"
......@@ -224,8 +226,7 @@ void LoginDisplayWebUI::ShowKioskAutolaunchScreen() {
}
void LoginDisplayWebUI::ShowWrongHWIDScreen() {
if (delegate_)
delegate_->ShowWrongHWIDScreen();
LoginDisplayHost::default_host()->StartWizard(WrongHWIDScreenView::kScreenId);
}
void LoginDisplayWebUI::SetWebUIHandler(
......@@ -255,10 +256,6 @@ bool LoginDisplayWebUI::IsUserSigninCompleted() const {
return is_signin_completed();
}
void LoginDisplayWebUI::Signout() {
delegate_->Signout();
}
void LoginDisplayWebUI::OnUserActivity(const ui::Event* event) {
if (delegate_)
delegate_->ResetAutoLoginTimer();
......
......@@ -51,8 +51,6 @@ class LoginDisplayWebUI : public LoginDisplay,
void Login(const UserContext& user_context,
const SigninSpecifics& specifics) override;
bool IsSigninInProgress() const override;
void Signout() override;
void OnSigninScreenReady() override;
void CancelUserAdding() override;
void ShowEnterpriseEnrollmentScreen() override;
......
......@@ -91,9 +91,6 @@ class SigninScreenHandlerDelegate {
// Returns true if sign in is in progress.
virtual bool IsSigninInProgress() const = 0;
// Signs out if the screen is currently locked.
virtual void Signout() = 0;
// --------------- Shared with login display methods.
// Notify the delegate when the sign-in UI is finished loading.
virtual void OnSigninScreenReady() = 0;
......
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