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

Unified Diff: chrome/browser/extensions/api/push_messaging/push_messaging_api.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: Rebasing to include the update to ProfileSyncService: r224220 Created 7 years, 3 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/extensions/api/identity/identity_api.cc ('k') | chrome/browser/google_apis/auth_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/push_messaging/push_messaging_api.cc
diff --git a/chrome/browser/extensions/api/push_messaging/push_messaging_api.cc b/chrome/browser/extensions/api/push_messaging/push_messaging_api.cc
index d9fdf77b06863d512a64b5ad359ae24e7c34f969..5e7e04fa79d8edbb9082cb1b04bddc0bd602afb8 100644
--- a/chrome/browser/extensions/api/push_messaging/push_messaging_api.cc
+++ b/chrome/browser/extensions/api/push_messaging/push_messaging_api.cc
@@ -126,9 +126,10 @@ void PushMessagingGetChannelIdFunction::StartAccessTokenFetch() {
std::vector<std::string> scope_vector =
extensions::ObfuscatedGaiaIdFetcher::GetScopes();
OAuth2TokenService::ScopeSet scopes(scope_vector.begin(), scope_vector.end());
- fetcher_access_token_request_ =
- ProfileOAuth2TokenServiceFactory::GetForProfile(profile())
- ->StartRequest(scopes, this);
+ ProfileOAuth2TokenService* token_service =
+ ProfileOAuth2TokenServiceFactory::GetForProfile(profile());
+ fetcher_access_token_request_ = token_service->StartRequest(
+ token_service->GetPrimaryAccountId(), scopes, this);
}
void PushMessagingGetChannelIdFunction::OnRefreshTokenAvailable(
@@ -189,8 +190,10 @@ void PushMessagingGetChannelIdFunction::StartGaiaIdFetch(
// Check if the user is logged in.
bool PushMessagingGetChannelIdFunction::IsUserLoggedIn() const {
- return ProfileOAuth2TokenServiceFactory::GetForProfile(profile())
- ->RefreshTokenIsAvailable();
+ ProfileOAuth2TokenService* token_service =
+ ProfileOAuth2TokenServiceFactory::GetForProfile(profile());
+ return token_service->RefreshTokenIsAvailable(
+ token_service->GetPrimaryAccountId());
}
void PushMessagingGetChannelIdFunction::ReportResult(
« no previous file with comments | « chrome/browser/extensions/api/identity/identity_api.cc ('k') | chrome/browser/google_apis/auth_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698