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

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: Bugfix in original easy unlock code' 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 2a9e3d07deb5c8fcb0c9aedcb782abe78e84d76c..a5b817a1bb08fa76bcecb9cc0f788afc4a3f91eb 100644
--- a/chrome/browser/signin/easy_unlock_service_regular.cc
+++ b/chrome/browser/signin/easy_unlock_service_regular.cc
@@ -99,7 +99,7 @@ EasyUnlockServiceRegular::GetProximityAuthPrefManager() {
void EasyUnlockServiceRegular::LoadRemoteDevices() {
if (device_manager_->unlock_keys().empty()) {
- SetProximityAuthDevices(GetUserEmail(), proximity_auth::RemoteDeviceList());
+ SetProximityAuthDevices(GetAccountId(), proximity_auth::RemoteDeviceList());
return;
}
@@ -115,7 +115,7 @@ void EasyUnlockServiceRegular::LoadRemoteDevices() {
void EasyUnlockServiceRegular::OnRemoteDevicesLoaded(
const proximity_auth::RemoteDeviceList& remote_devices) {
- SetProximityAuthDevices(GetUserEmail(), remote_devices);
+ SetProximityAuthDevices(GetAccountId(), remote_devices);
#if defined(OS_CHROMEOS)
// We need to store a copy of |remote devices_| in the TPM, so it can be
@@ -153,7 +153,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
@@ -161,7 +161,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() {
@@ -212,7 +214,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.
@@ -369,13 +371,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();
}
@@ -543,7 +545,7 @@ void EasyUnlockServiceRegular::OnScreenDidUnlock(
}
void EasyUnlockServiceRegular::OnFocusedUserChanged(
- const std::string& user_id) {
+ const AccountId& account_id) {
// Nothing to do.
}
@@ -589,8 +591,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() {
« no previous file with comments | « chrome/browser/signin/easy_unlock_service_regular.h ('k') | chrome/browser/signin/easy_unlock_service_signin_chromeos.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698