Index: chrome/browser/history/web_history_service.cc |
diff --git a/chrome/browser/history/web_history_service.cc b/chrome/browser/history/web_history_service.cc |
index 8dfe959c72b8a4308353282f2f0b36c8f21a5350..12d13e10e41981d1889f1a1d76868a7aee46174f 100644 |
--- a/chrome/browser/history/web_history_service.cc |
+++ b/chrome/browser/history/web_history_service.cc |
@@ -13,6 +13,8 @@ |
#include "base/values.h" |
#include "chrome/browser/signin/profile_oauth2_token_service.h" |
#include "chrome/browser/signin/profile_oauth2_token_service_factory.h" |
+#include "chrome/browser/signin/signin_manager.h" |
+#include "chrome/browser/signin/signin_manager_factory.h" |
#include "google_apis/gaia/gaia_urls.h" |
#include "google_apis/gaia/google_service_auth_error.h" |
#include "google_apis/gaia/oauth2_token_service.h" |
@@ -82,8 +84,10 @@ class RequestImpl : public WebHistoryService::Request, |
ProfileOAuth2TokenService* token_service = |
ProfileOAuth2TokenServiceFactory::GetForProfile(profile_); |
+ SigninManagerBase* signin_manager = |
+ SigninManagerFactory::GetForProfile(profile_); |
token_request_ = token_service->StartRequest( |
- token_service->GetPrimaryAccountId(), oauth_scopes, this); |
+ signin_manager->GetAuthenticatedAccountId(), oauth_scopes, this); |
is_pending_ = true; |
} |
@@ -103,9 +107,12 @@ class RequestImpl : public WebHistoryService::Request, |
oauth_scopes.insert(kHistoryOAuthScope); |
ProfileOAuth2TokenService* token_service = |
ProfileOAuth2TokenServiceFactory::GetForProfile(profile_); |
- token_service->InvalidateToken(token_service->GetPrimaryAccountId(), |
- oauth_scopes, |
- access_token_); |
+ SigninManagerBase* signin_manager = |
+ SigninManagerFactory::GetForProfile(profile_); |
+ token_service->InvalidateToken( |
+ signin_manager->GetAuthenticatedAccountId(), |
+ oauth_scopes, |
+ access_token_); |
access_token_.clear(); |
Start(); |