| Index: chrome/browser/signin/easy_unlock_service_regular.cc
|
| diff --git a/chrome/browser/signin/easy_unlock_service_regular.cc b/chrome/browser/signin/easy_unlock_service_regular.cc
|
| index b02d769c63fb10c99a77e4721da353a8eb14942d..8e7ab3652e13b29a081f095c15ac26a9e9e9ec71 100644
|
| --- a/chrome/browser/signin/easy_unlock_service_regular.cc
|
| +++ b/chrome/browser/signin/easy_unlock_service_regular.cc
|
| @@ -93,14 +93,8 @@ EasyUnlockService::Type EasyUnlockServiceRegular::GetType() const {
|
| return EasyUnlockService::TYPE_REGULAR;
|
| }
|
|
|
| -std::string EasyUnlockServiceRegular::GetUserEmail() const {
|
| - const SigninManagerBase* signin_manager =
|
| - SigninManagerFactory::GetForProfileIfExists(profile());
|
| - // |profile| has to be a signed-in profile with SigninManager already
|
| - // created. Otherwise, just crash to collect stack.
|
| - DCHECK(signin_manager);
|
| - const std::string user_email = signin_manager->GetAuthenticatedUsername();
|
| - return user_email.empty() ? user_email : gaia::CanonicalizeEmail(user_email);
|
| +user_manager::UserID EasyUnlockServiceRegular::GetUserID() const {
|
| + return user_manager::UserID::FromUserEmail(GetUserEmail());
|
| }
|
|
|
| void EasyUnlockServiceRegular::LaunchSetup() {
|
| @@ -151,7 +145,7 @@ void EasyUnlockServiceRegular::SetHardlockAfterKeyOperation(
|
| EasyUnlockScreenlockStateHandler::HardlockState state_on_success,
|
| bool success) {
|
| if (success)
|
| - SetHardlockStateForUser(GetUserEmail(), state_on_success);
|
| + SetHardlockStateForUser(GetUserID(), state_on_success);
|
|
|
| // Even if the refresh keys operation suceeded, we still fetch and check the
|
| // cryptohome keys against the keys in local preferences as a sanity check.
|
| @@ -267,13 +261,13 @@ std::string EasyUnlockServiceRegular::GetWrappedSecret() const {
|
| }
|
|
|
| void EasyUnlockServiceRegular::RecordEasySignInOutcome(
|
| - const std::string& user_id,
|
| + const user_manager::UserID& user_id,
|
| bool success) const {
|
| NOTREACHED();
|
| }
|
|
|
| void EasyUnlockServiceRegular::RecordPasswordLoginEvent(
|
| - const std::string& user_id) const {
|
| + const user_manager::UserID& user_id) const {
|
| NOTREACHED();
|
| }
|
|
|
| @@ -392,10 +386,20 @@ void EasyUnlockServiceRegular::OnScreenDidUnlock(
|
| }
|
|
|
| void EasyUnlockServiceRegular::OnFocusedUserChanged(
|
| - const std::string& user_id) {
|
| + const user_manager::UserID& user_id) {
|
| // Nothing to do.
|
| }
|
|
|
| +std::string EasyUnlockServiceRegular::GetUserEmail() const {
|
| + const SigninManagerBase* signin_manager =
|
| + SigninManagerFactory::GetForProfileIfExists(profile());
|
| + // |profile| has to be a signed-in profile with SigninManager already
|
| + // created. Otherwise, just crash to collect stack.
|
| + DCHECK(signin_manager);
|
| + const std::string user_email = signin_manager->GetAuthenticatedUsername();
|
| + return user_email.empty() ? user_email : gaia::CanonicalizeEmail(user_email);
|
| +}
|
| +
|
| void EasyUnlockServiceRegular::OnPrefsChanged() {
|
| SyncProfilePrefsToLocalState();
|
| UpdateAppState();
|
|
|