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

Unified Diff: chrome/browser/signin/mutable_profile_oauth2_token_service.cc

Issue 109783003: Create signin component and componentize TokenWebData. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review Created 6 years, 11 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/DEPS ('k') | chrome/browser/signin/mutable_profile_oauth2_token_service_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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));
}
« no previous file with comments | « chrome/browser/DEPS ('k') | chrome/browser/signin/mutable_profile_oauth2_token_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698