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

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

Issue 63253003: Fix issues with token refresh in AccountReconcilor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: wip Created 7 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/android_profile_oauth2_token_service.cc
diff --git a/chrome/browser/signin/android_profile_oauth2_token_service.cc b/chrome/browser/signin/android_profile_oauth2_token_service.cc
index ae4471473b8d9ada9ce94343df53bb6c122bdbf3..08963ff87593a4631a5c0b029270be0c8b6d8896 100644
--- a/chrome/browser/signin/android_profile_oauth2_token_service.cc
+++ b/chrome/browser/signin/android_profile_oauth2_token_service.cc
@@ -159,7 +159,12 @@ void AndroidProfileOAuth2TokenService::ValidateAccounts(JNIEnv* env,
accounts,
&account_ids);
std::string signed_in_account = ConvertJavaStringToUTF8(env, j_current_acc);
+ ValidateAccounts(signed_in_account, account_ids);
+}
+void AndroidProfileOAuth2TokenService::ValidateAccounts(
+ const std::string& signed_in_account,
+ const std::vector<std::string>& account_ids) {
if (signed_in_account.empty())
return;
@@ -167,7 +172,17 @@ void AndroidProfileOAuth2TokenService::ValidateAccounts(JNIEnv* env,
account_ids.end(),
signed_in_account) != account_ids.end()) {
// Currently signed in account still exists among accounts on system.
+ std::vector<std::string> ids = GetAccounts();
+
+ // Always fire the primary signed in account first.
FireRefreshTokenAvailable(signed_in_account);
+
+ for (std::vector<std::string>::iterator it = ids.begin();
+ it != ids.end(); it++) {
+ if (*it != signed_in_account) {
+ FireRefreshTokenAvailable(*it);
+ }
+ }
} else {
// Currently signed in account does not any longer exist among accounts on
// system.
« no previous file with comments | « chrome/browser/signin/android_profile_oauth2_token_service.h ('k') | chrome/browser/signin/google_auto_login_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698