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

Unified Diff: chrome/browser/signin/easy_unlock_service_regular.cc

Issue 1494153002: This CL replaces e-mail with AccountId in easy signin code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update after review. Created 5 years 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/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 90e017aa6e071bec9f584be7cdad2bde358156d7..076bf037924cc98a30887917b334e586f2c2c936 100644
--- a/chrome/browser/signin/easy_unlock_service_regular.cc
+++ b/chrome/browser/signin/easy_unlock_service_regular.cc
@@ -155,7 +155,7 @@ EasyUnlockService::Type EasyUnlockServiceRegular::GetType() const {
return EasyUnlockService::TYPE_REGULAR;
}
-std::string EasyUnlockServiceRegular::GetUserEmail() const {
+AccountId EasyUnlockServiceRegular::GetAccountId() const {
const SigninManagerBase* signin_manager =
SigninManagerFactory::GetForProfileIfExists(profile());
// |profile| has to be a signed-in profile with SigninManager already
@@ -163,7 +163,9 @@ std::string EasyUnlockServiceRegular::GetUserEmail() const {
DCHECK(signin_manager);
const std::string user_email =
signin_manager->GetAuthenticatedAccountInfo().email;
- return user_email.empty() ? user_email : gaia::CanonicalizeEmail(user_email);
+ return user_email.empty()
+ ? EmptyAccountId()
+ : AccountId::FromUserEmail(gaia::CanonicalizeEmail(user_email));
}
void EasyUnlockServiceRegular::LaunchSetup() {
@@ -214,7 +216,7 @@ void EasyUnlockServiceRegular::SetHardlockAfterKeyOperation(
EasyUnlockScreenlockStateHandler::HardlockState state_on_success,
bool success) {
if (success)
- SetHardlockStateForUser(GetUserEmail(), state_on_success);
+ SetHardlockStateForUser(GetAccountId(), 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.
@@ -371,13 +373,13 @@ std::string EasyUnlockServiceRegular::GetWrappedSecret() const {
}
void EasyUnlockServiceRegular::RecordEasySignInOutcome(
- const std::string& user_id,
+ const AccountId& account_id,
bool success) const {
NOTREACHED();
}
void EasyUnlockServiceRegular::RecordPasswordLoginEvent(
- const std::string& user_id) const {
+ const AccountId& account_id) const {
NOTREACHED();
}
@@ -545,7 +547,7 @@ void EasyUnlockServiceRegular::OnScreenDidUnlock(
}
void EasyUnlockServiceRegular::OnFocusedUserChanged(
- const std::string& user_id) {
+ const AccountId& account_id) {
// Nothing to do.
}
@@ -591,8 +593,8 @@ void EasyUnlockServiceRegular::SyncProfilePrefsToLocalState() {
DictionaryPrefUpdate update(local_state,
prefs::kEasyUnlockLocalStateUserPrefs);
- std::string user_email = GetUserEmail();
- update->SetWithoutPathExpansion(user_email, user_prefs_dict.Pass());
+ update->SetWithoutPathExpansion(GetAccountId().GetUserEmail(),
+ user_prefs_dict.Pass());
}
cryptauth::GcmDeviceInfo EasyUnlockServiceRegular::GetGcmDeviceInfo() {

Powered by Google App Engine
This is Rietveld 408576698