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

Unified Diff: chromeos/login/auth/extended_authenticator_impl.cc

Issue 1412813003: This CL replaces user_manager::UserID with AccountId. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@468875--Chrome-OS-handles-deletion-of-Gmail-account-poorly--Create-AccountID-structure-part2--user_names
Patch Set: Fix Win GN build. Created 5 years, 1 month 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
« no previous file with comments | « chromeos/login/auth/cryptohome_authenticator.cc ('k') | chromeos/login/auth/fake_extended_authenticator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/login/auth/extended_authenticator_impl.cc
diff --git a/chromeos/login/auth/extended_authenticator_impl.cc b/chromeos/login/auth/extended_authenticator_impl.cc
index 0aa10e59b76fac6235366d3ec576feba59c0677f..88ec3cf509cfb95fb27d2c83e422e862ec907685 100644
--- a/chromeos/login/auth/extended_authenticator_impl.cc
+++ b/chromeos/login/auth/extended_authenticator_impl.cc
@@ -17,6 +17,7 @@
#include "chromeos/login/auth/key.h"
#include "chromeos/login/auth/user_context.h"
#include "chromeos/login_event_recorder.h"
+#include "components/signin/core/account_id/account_id.h"
#include "crypto/sha2.h"
#include "google_apis/gaia/gaia_auth_util.h"
@@ -91,7 +92,7 @@ void ExtendedAuthenticatorImpl::CreateMount(
for (size_t i = 0; i < keys.size(); i++) {
mount.create_keys.push_back(keys[i]);
}
- UserContext context(user_id);
+ UserContext context(AccountId::FromUserEmail(user_id));
Key key(keys.front().secret);
key.SetLabel(keys.front().label);
context.SetKey(key);
@@ -186,7 +187,8 @@ void ExtendedAuthenticatorImpl::DoAuthenticateToMount(
const UserContext& user_context) {
RecordStartMarker("MountEx");
- std::string canonicalized = gaia::CanonicalizeEmail(user_context.GetUserID());
+ const std::string canonicalized =
+ gaia::CanonicalizeEmail(user_context.GetAccountId().GetUserEmail());
cryptohome::Identification id(canonicalized);
const Key* const key = user_context.GetKey();
cryptohome::Authorization auth(key->GetSecret(), key->GetLabel());
@@ -208,7 +210,8 @@ void ExtendedAuthenticatorImpl::DoAuthenticateToCheck(
const UserContext& user_context) {
RecordStartMarker("CheckKeyEx");
- std::string canonicalized = gaia::CanonicalizeEmail(user_context.GetUserID());
+ const std::string canonicalized =
+ gaia::CanonicalizeEmail(user_context.GetAccountId().GetUserEmail());
cryptohome::Identification id(canonicalized);
const Key* const key = user_context.GetKey();
cryptohome::Authorization auth(key->GetSecret(), key->GetLabel());
@@ -229,7 +232,8 @@ void ExtendedAuthenticatorImpl::DoAddKey(const cryptohome::KeyDefinition& key,
const UserContext& user_context) {
RecordStartMarker("AddKeyEx");
- std::string canonicalized = gaia::CanonicalizeEmail(user_context.GetUserID());
+ const std::string canonicalized =
+ gaia::CanonicalizeEmail(user_context.GetAccountId().GetUserEmail());
cryptohome::Identification id(canonicalized);
const Key* const auth_key = user_context.GetKey();
cryptohome::Authorization auth(auth_key->GetSecret(), auth_key->GetLabel());
@@ -253,7 +257,8 @@ void ExtendedAuthenticatorImpl::DoUpdateKeyAuthorized(
const UserContext& user_context) {
RecordStartMarker("UpdateKeyAuthorized");
- std::string canonicalized = gaia::CanonicalizeEmail(user_context.GetUserID());
+ const std::string canonicalized =
+ gaia::CanonicalizeEmail(user_context.GetAccountId().GetUserEmail());
cryptohome::Identification id(canonicalized);
const Key* const auth_key = user_context.GetKey();
cryptohome::Authorization auth(auth_key->GetSecret(), auth_key->GetLabel());
@@ -275,7 +280,8 @@ void ExtendedAuthenticatorImpl::DoRemoveKey(const std::string& key_to_remove,
const UserContext& user_context) {
RecordStartMarker("RemoveKeyEx");
- std::string canonicalized = gaia::CanonicalizeEmail(user_context.GetUserID());
+ const std::string canonicalized =
+ gaia::CanonicalizeEmail(user_context.GetAccountId().GetUserEmail());
cryptohome::Identification id(canonicalized);
const Key* const auth_key = user_context.GetKey();
cryptohome::Authorization auth(auth_key->GetSecret(), auth_key->GetLabel());
« no previous file with comments | « chromeos/login/auth/cryptohome_authenticator.cc ('k') | chromeos/login/auth/fake_extended_authenticator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698