Index: chrome/browser/signin/mutable_profile_oauth2_token_service.cc |
diff --git a/chrome/browser/signin/mutable_profile_oauth2_token_service.cc b/chrome/browser/signin/mutable_profile_oauth2_token_service.cc |
index f940bcc6c52cca31781ed6271a621b353bfb052b..aa2ce05630fa5924ebdf3023f169b0798172c2f7 100644 |
--- a/chrome/browser/signin/mutable_profile_oauth2_token_service.cc |
+++ b/chrome/browser/signin/mutable_profile_oauth2_token_service.cc |
@@ -5,7 +5,8 @@ |
#include "chrome/browser/signin/mutable_profile_oauth2_token_service.h" |
#include "chrome/browser/profiles/profile.h" |
-#include "chrome/browser/webdata/token_web_data.h" |
+#include "chrome/browser/webdata/web_data_service_factory.h" |
+#include "components/signin/core/webdata/token_web_data.h" |
#include "components/webdata/common/web_data_service_base.h" |
#include "google_apis/gaia/gaia_auth_fetcher.h" |
#include "google_apis/gaia/gaia_constants.h" |
@@ -82,7 +83,8 @@ MutableProfileOAuth2TokenService::~MutableProfileOAuth2TokenService() { |
void MutableProfileOAuth2TokenService::Shutdown() { |
if (web_data_service_request_ != 0) { |
scoped_refptr<TokenWebData> token_web_data = |
- TokenWebData::FromBrowserContext(profile()); |
+ WebDataServiceFactory::GetTokenWebDataForProfile( |
+ profile(), Profile::EXPLICIT_ACCESS); |
DCHECK(token_web_data.get()); |
token_web_data->CancelRequest(web_data_service_request_); |
web_data_service_request_ = 0; |
@@ -101,7 +103,8 @@ void MutableProfileOAuth2TokenService::LoadCredentials() { |
CancelAllRequests(); |
refresh_tokens().clear(); |
scoped_refptr<TokenWebData> token_web_data = |
- TokenWebData::FromBrowserContext(profile()); |
+ WebDataServiceFactory::GetTokenWebDataForProfile( |
+ profile(), Profile::EXPLICIT_ACCESS); |
if (token_web_data.get()) |
web_data_service_request_ = token_web_data->GetAllTokens(this); |
} |
@@ -156,7 +159,8 @@ void MutableProfileOAuth2TokenService::LoadAllCredentialsIntoMemory( |
if (IsLegacyServiceId(prefixed_account_id)) { |
scoped_refptr<TokenWebData> token_web_data = |
- TokenWebData::FromBrowserContext(profile()); |
+ WebDataServiceFactory::GetTokenWebDataForProfile( |
+ profile(), Profile::EXPLICIT_ACCESS); |
if (token_web_data.get()) |
token_web_data->RemoveTokenForService(prefixed_account_id); |
} else { |
@@ -183,7 +187,8 @@ void MutableProfileOAuth2TokenService::PersistCredentials( |
const std::string& account_id, |
const std::string& refresh_token) { |
scoped_refptr<TokenWebData> token_web_data = |
- TokenWebData::FromBrowserContext(profile()); |
+ WebDataServiceFactory::GetTokenWebDataForProfile( |
+ profile(), Profile::EXPLICIT_ACCESS); |
if (token_web_data.get()) { |
token_web_data->SetTokenForService(ApplyAccountIdPrefix(account_id), |
refresh_token); |
@@ -193,7 +198,8 @@ void MutableProfileOAuth2TokenService::PersistCredentials( |
void MutableProfileOAuth2TokenService::ClearPersistedCredentials( |
const std::string& account_id) { |
scoped_refptr<TokenWebData> token_web_data = |
- TokenWebData::FromBrowserContext(profile()); |
+ WebDataServiceFactory::GetTokenWebDataForProfile( |
+ profile(), Profile::EXPLICIT_ACCESS); |
if (token_web_data.get()) |
token_web_data->RemoveTokenForService(ApplyAccountIdPrefix(account_id)); |
} |