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..76c27dc08c08473128e6db90882422b87b14c5ae 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) |