Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1072)

Unified Diff: chrome/browser/chromeos/login/lock/screen_locker.cc

Issue 2429033003: cros: Cleanup lock screen and OOBE C++ backing code. (Closed)
Patch Set: Initial patch Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/login/lock/screen_locker.cc
diff --git a/chrome/browser/chromeos/login/lock/screen_locker.cc b/chrome/browser/chromeos/login/lock/screen_locker.cc
index 5b897a931da42912cc71ff07461e409cdc053e8f..89404268439fe5c1a07d1540471501317bf3eb78 100644
--- a/chrome/browser/chromeos/login/lock/screen_locker.cc
+++ b/chrome/browser/chromeos/login/lock/screen_locker.cc
@@ -163,16 +163,15 @@ void ScreenLocker::Init() {
authenticator_ = UserSessionManager::GetInstance()->CreateAuthenticator(this);
extended_authenticator_ = ExtendedAuthenticator::Create(this);
- delegate_.reset(new WebUIScreenLocker(this));
- delegate_->LockScreen();
+ web_ui_.reset(new WebUIScreenLocker(this));
+ web_ui_->LockScreen();
// Ownership of |icon_image_source| is passed.
screenlock_icon_provider_.reset(new ScreenlockIconProvider);
ScreenlockIconSource* screenlock_icon_source =
new ScreenlockIconSource(screenlock_icon_provider_->AsWeakPtr());
- content::URLDataSource::Add(
- GetAssociatedWebUI()->GetWebContents()->GetBrowserContext(),
- screenlock_icon_source);
+ content::URLDataSource::Add(web_ui()->GetWebContents()->GetBrowserContext(),
+ screenlock_icon_source);
}
void ScreenLocker::OnAuthFailure(const AuthFailure& error) {
@@ -194,10 +193,10 @@ void ScreenLocker::OnAuthFailure(const AuthFailure& error) {
// Don't enable signout button here as we're showing
// MessageBubble.
- delegate_->ShowErrorMessage(incorrect_passwords_count_++ ?
- IDS_LOGIN_ERROR_AUTHENTICATING_2ND_TIME :
- IDS_LOGIN_ERROR_AUTHENTICATING,
- HelpAppLauncher::HELP_CANT_ACCESS_ACCOUNT);
+ web_ui_->ShowErrorMessage(incorrect_passwords_count_++
+ ? IDS_LOGIN_ERROR_AUTHENTICATING_2ND_TIME
+ : IDS_LOGIN_ERROR_AUTHENTICATING,
+ HelpAppLauncher::HELP_CANT_ACCESS_ACCOUNT);
if (auth_status_consumer_)
auth_status_consumer_->OnAuthFailure(error);
@@ -253,7 +252,7 @@ void ScreenLocker::OnAuthSuccess(const UserContext& user_context) {
FROM_HERE, base::Bind(&ScreenLocker::UnlockOnLoginSuccess,
weak_factory_.GetWeakPtr()),
base::TimeDelta::FromMilliseconds(kUnlockGuardTimeoutMs));
- delegate_->AnimateAuthenticationSuccess();
+ web_ui_->AnimateAuthenticationSuccess();
}
void ScreenLocker::OnPasswordAuthSuccess(const UserContext& user_context) {
@@ -287,8 +286,7 @@ void ScreenLocker::Authenticate(const UserContext& user_context) {
<< "Invalid user trying to unlock.";
authentication_start_time_ = base::Time::Now();
- delegate_->SetInputEnabled(false);
- delegate_->OnAuthenticate();
+ web_ui_->SetInputEnabled(false);
is_pin_attempt_ = user_context.IsUsingPin();
const user_manager::User* user = FindUnlockUser(user_context.GetAccountId());
@@ -343,11 +341,11 @@ const user_manager::User* ScreenLocker::FindUnlockUser(
}
void ScreenLocker::ClearErrors() {
- delegate_->ClearErrors();
+ web_ui_->ClearErrors();
}
void ScreenLocker::Signout() {
- delegate_->ClearErrors();
+ web_ui_->ClearErrors();
content::RecordAction(UserMetricsAction("ScreenLocker_Signout"));
// We expect that this call will not wait for any user input.
// If it changes at some point, we will need to force exit.
@@ -358,14 +356,14 @@ void ScreenLocker::Signout() {
}
void ScreenLocker::EnableInput() {
- delegate_->SetInputEnabled(true);
+ web_ui_->SetInputEnabled(true);
}
void ScreenLocker::ShowErrorMessage(int error_msg_id,
HelpAppLauncher::HelpTopic help_topic_id,
bool sign_out_only) {
- delegate_->SetInputEnabled(!sign_out_only);
- delegate_->ShowErrorMessage(error_msg_id, help_topic_id);
+ web_ui_->SetInputEnabled(!sign_out_only);
+ web_ui_->ShowErrorMessage(error_msg_id, help_topic_id);
}
void ScreenLocker::SetLoginStatusConsumer(
@@ -537,10 +535,6 @@ void ScreenLocker::ScreenLockReady() {
->EnableLockScreenLayouts();
}
-content::WebUI* ScreenLocker::GetAssociatedWebUI() {
- return delegate_->GetAssociatedWebUI();
-}
-
bool ScreenLocker::IsUserLoggedIn(const AccountId& account_id) const {
for (user_manager::User* user : users_) {
if (user->GetAccountId() == account_id)

Powered by Google App Engine
This is Rietveld 408576698