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 5cc854fc911937ed235f076996d7119c478debd9..8dc2cf7ad73529c0bee3f73ebbb5466bf1677ea9 100644 |
--- a/chrome/browser/extensions/api/push_messaging/push_messaging_api.cc |
+++ b/chrome/browser/extensions/api/push_messaging/push_messaging_api.cc |
@@ -127,9 +127,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( |
@@ -190,8 +191,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( |