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

Unified Diff: chrome/browser/chromeos/login/session/user_session_manager.cc

Issue 2752873002: Fix refresh token is not available after Chrome restart on crash. (Closed)
Patch Set: Created 3 years, 9 months 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/session/user_session_manager.cc
diff --git a/chrome/browser/chromeos/login/session/user_session_manager.cc b/chrome/browser/chromeos/login/session/user_session_manager.cc
index abb9800fe02076957094ae59cd1ff309fa824b9d..a68c50f47576f4fc7b044e46aca15f13d93983f8 100644
--- a/chrome/browser/chromeos/login/session/user_session_manager.cc
+++ b/chrome/browser/chromeos/login/session/user_session_manager.cc
@@ -549,6 +549,18 @@ void UserSessionManager::RestoreAuthenticationSession(Profile* user_profile) {
const user_manager::User* user =
ProfileHelper::Get()->GetUserByProfile(user_profile);
DCHECK(user);
+
+ if (user_manager->GetPrimaryUser() == user) {
+ DCHECK(user->HasGaiaAccount());
+ SigninManagerBase* signin_manager =
+ SigninManagerFactory::GetForProfile(user_profile);
+ if (signin_manager->GetAuthenticatedAccountId().empty()) {
+ signin_manager->SetAuthenticatedAccountInfo(
+ user->GetAccountId().GetGaiaId(),
+ user->GetAccountId().GetUserEmail());
+ }
+ }
+
if (!net::NetworkChangeNotifier::IsOffline()) {
pending_signin_restore_sessions_.erase(user->GetAccountId().GetUserEmail());
RestoreAuthSessionImpl(user_profile, false /* has_auth_cookies */);

Powered by Google App Engine
This is Rietveld 408576698