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

Unified Diff: chrome/browser/chromeos/login/signin/auth_sync_observer.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
Index: chrome/browser/chromeos/login/signin/auth_sync_observer.cc
diff --git a/chrome/browser/chromeos/login/signin/auth_sync_observer.cc b/chrome/browser/chromeos/login/signin/auth_sync_observer.cc
index 8fa574959b7f0d25a03e412db313ca62c041ae3c..99b50e5396a03b5aab1d24758ee96b86c72cc926 100644
--- a/chrome/browser/chromeos/login/signin/auth_sync_observer.cc
+++ b/chrome/browser/chromeos/login/signin/auth_sync_observer.cc
@@ -62,14 +62,14 @@ void AuthSyncObserver::OnStateChanged() {
// TODO(nkostylev): Remove after crosbug.com/25978 is implemented.
LOG(WARNING) << "Invalidate OAuth token because of a sync error: "
<< sync_service->GetAuthError().ToString();
- std::string email = user->email();
- DCHECK(!email.empty());
+ const AccountId& account_id = user->GetAccountId();
+ DCHECK(account_id.is_valid());
// TODO(nkostyelv): Change observer after active user has changed.
user_manager::User::OAuthTokenStatus old_status =
user->oauth_token_status();
user_manager::UserManager::Get()->SaveUserOAuthStatus(
- email, user_manager::User::OAUTH2_TOKEN_STATUS_INVALID);
- RecordReauthReason(email, ReauthReason::SYNC_FAILED);
+ account_id, user_manager::User::OAUTH2_TOKEN_STATUS_INVALID);
+ RecordReauthReason(account_id, ReauthReason::SYNC_FAILED);
if (user->GetType() == user_manager::USER_TYPE_SUPERVISED &&
old_status != user_manager::User::OAUTH2_TOKEN_STATUS_INVALID) {
// Attempt to restore token from file.
@@ -89,7 +89,7 @@ void AuthSyncObserver::OnStateChanged() {
LOG(ERROR) <<
"Got an incorrectly invalidated token case, restoring token status.";
user_manager::UserManager::Get()->SaveUserOAuthStatus(
- user->email(), user_manager::User::OAUTH2_TOKEN_STATUS_VALID);
+ user->GetAccountId(), user_manager::User::OAUTH2_TOKEN_STATUS_VALID);
content::RecordAction(
base::UserMetricsAction("ManagedUsers_Chromeos_Sync_Recovered"));
}

Powered by Google App Engine
This is Rietveld 408576698