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

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

Issue 213823004: Calls FireRefreshTokenRevoked if an account is removed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
« no previous file with comments | « chrome/browser/signin/android_profile_oauth2_token_service.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 71fe1c3b684c752705b2089b178ef77ef6c1e1ac..224f4434a6b64a7bc7c18ab7c5e6e640aabe61b4 100644
--- a/chrome/browser/signin/android_profile_oauth2_token_service.cc
+++ b/chrome/browser/signin/android_profile_oauth2_token_service.cc
@@ -181,6 +181,23 @@ void AndroidProfileOAuth2TokenService::ValidateAccounts(
// Currently signed in account still exists among accounts on system.
std::vector<std::string> ids = GetAccounts();
Roger Tawa OOO till Jul 10th 2014/03/27 15:46:45 In what cases is |ids| going to be different from
acleung1 2014/03/27 21:09:54 Good catch. It's a mistake from previous CL. Was g
+ // Test to see if we an account is removed from the Android AccountManager.
Roger Tawa OOO till Jul 10th 2014/03/27 15:46:45 Remove "if we" ?
acleung1 2014/03/27 21:09:54 Done.
+ // If so, invoke FireRefreshTokenRevoked to notify the reconcilor.
+ for (std::vector<std::string>::iterator it = current_accounts_.begin();
+ it != current_accounts_.end(); it++) {
Roger Tawa OOO till Jul 10th 2014/03/27 15:46:45 Indent one more.
acleung1 2014/03/27 21:09:54 Done.
+ if (*it == signed_in_account)
+ continue;
+
+ if (std::find(account_ids.begin(),
+ account_ids.end(),
+ *it) == account_ids.end()) {
+ FireRefreshTokenRevoked(*it);
+ }
+ }
+
+ current_accounts_.clear();
+ current_accounts_.push_back(signed_in_account);
+
// Always fire the primary signed in account first.
FireRefreshTokenAvailable(signed_in_account);
@@ -188,6 +205,7 @@ void AndroidProfileOAuth2TokenService::ValidateAccounts(
it != ids.end(); it++) {
if (*it != signed_in_account) {
FireRefreshTokenAvailable(*it);
+ current_accounts_.push_back(*it);
}
}
} else {
« no previous file with comments | « chrome/browser/signin/android_profile_oauth2_token_service.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698