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

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

Issue 150003004: Replace PO2TS::GetPrimaryAccountId() with SMB::GetAuthenticatedAccountId. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 6 years, 10 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 6f2b561ee2214e23c2932412f92c37047f177412..11ec47ba0f2a109b4ed1f7dc22231f7973ac8d3a 100644
--- a/chrome/browser/invalidation/ticl_invalidation_service.cc
+++ b/chrome/browser/invalidation/ticl_invalidation_service.cc
@@ -171,7 +171,7 @@ void TiclInvalidationService::RequestAccessToken() {
oauth2_scopes.insert(kOAuth2Scopes[i]);
// Invalidate previous token, otherwise token service will return the same
// token again.
- const std::string& account_id = oauth2_token_service_->GetPrimaryAccountId();
+ const std::string& account_id = signin_manager_->GetAuthenticatedAccountId();
oauth2_token_service_->InvalidateToken(account_id,
oauth2_scopes,
access_token_);
@@ -229,7 +229,7 @@ void TiclInvalidationService::OnGetTokenFailure(
void TiclInvalidationService::OnRefreshTokenAvailable(
const std::string& account_id) {
- if (oauth2_token_service_->GetPrimaryAccountId() == account_id) {
+ if (signin_manager_->GetAuthenticatedAccountId() == account_id) {
if (!IsStarted() && IsReadyToStart()) {
StartInvalidator(PUSH_CLIENT_CHANNEL);
}
@@ -238,7 +238,7 @@ void TiclInvalidationService::OnRefreshTokenAvailable(
void TiclInvalidationService::OnRefreshTokenRevoked(
const std::string& account_id) {
- if (oauth2_token_service_->GetPrimaryAccountId() == account_id) {
+ if (signin_manager_->GetAuthenticatedAccountId() == account_id) {
access_token_.clear();
if (IsStarted()) {
UpdateInvalidatorCredentials();
@@ -301,7 +301,7 @@ bool TiclInvalidationService::IsReadyToStart() {
}
if (!oauth2_token_service_->RefreshTokenIsAvailable(
- oauth2_token_service_->GetPrimaryAccountId())) {
+ signin_manager_->GetAuthenticatedAccountId())) {
DVLOG(2)
<< "Not starting TiclInvalidationServce: Waiting for refresh token.";
return false;

Powered by Google App Engine
This is Rietveld 408576698