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

Unified Diff: chrome/browser/invalidation/ticl_invalidation_service.cc

Issue 23382008: Making OAuth2TokenService multi-login aware, updating callers, minor fixes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 4 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/invalidation/ticl_invalidation_service.cc
diff --git a/chrome/browser/invalidation/ticl_invalidation_service.cc b/chrome/browser/invalidation/ticl_invalidation_service.cc
index 140c990197c7a073b6adc7497376886d73776e23..2176ad01b28512cea6c605c6ee3e2d2f031d26ed 100644
--- a/chrome/browser/invalidation/ticl_invalidation_service.cc
+++ b/chrome/browser/invalidation/ticl_invalidation_service.cc
@@ -205,8 +205,8 @@ void TiclInvalidationService::RequestAccessToken() {
// token again.
oauth2_token_service_->InvalidateToken(oauth2_scopes, access_token_);
access_token_.clear();
- access_token_request_ =
- oauth2_token_service_->StartRequest(oauth2_scopes, this);
+ access_token_request_ = oauth2_token_service_->StartRequest(
+ signin_manager_->GetAuthenticatedUsername(), oauth2_scopes, this);
Andrew T Wilson (Slow) 2013/08/23 09:38:13 Why are we using GetAuthenticatedUsername() instea
fgorski 2013/08/23 19:13:35 Done. I left it in that way as a case study, antic
}
void TiclInvalidationService::OnGetTokenSuccess(
@@ -296,7 +296,8 @@ bool TiclInvalidationService::IsReadyToStart() {
return false;
}
- if (signin_manager_->GetAuthenticatedUsername().empty()) {
+ const std::string& account_id = signin_manager_->GetAuthenticatedUsername();
+ if (account_id.empty()) {
DVLOG(2) << "Not starting TiclInvalidationService: User is not signed in.";
return false;
}
@@ -307,7 +308,7 @@ bool TiclInvalidationService::IsReadyToStart() {
return false;
}
- if (!oauth2_token_service_->RefreshTokenIsAvailable()) {
+ if (!oauth2_token_service_->RefreshTokenIsAvailable(account_id)) {
DVLOG(2)
<< "Not starting TiclInvalidationServce: Waiting for refresh token.";
return false;

Powered by Google App Engine
This is Rietveld 408576698