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

Unified Diff: chrome/browser/managed_mode/managed_user_refresh_token_fetcher.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: Updates to AndroidPO2TS and removing the DCHECK(signin_manager) from GetPrimaryAccountId Created 7 years, 4 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
Index: chrome/browser/managed_mode/managed_user_refresh_token_fetcher.cc
diff --git a/chrome/browser/managed_mode/managed_user_refresh_token_fetcher.cc b/chrome/browser/managed_mode/managed_user_refresh_token_fetcher.cc
index 1d9e410c7078f701956de794e2f64475fffe4afb..6ce01d4103e659bc40c41238ce349da64349437a 100644
--- a/chrome/browser/managed_mode/managed_user_refresh_token_fetcher.cc
+++ b/chrome/browser/managed_mode/managed_user_refresh_token_fetcher.cc
@@ -52,7 +52,8 @@ class ManagedUserRefreshTokenFetcherImpl
public GaiaOAuthClient::Delegate {
public:
ManagedUserRefreshTokenFetcherImpl(OAuth2TokenService* oauth2_token_service,
- URLRequestContextGetter* context);
+ const std::string& account_id,
+ URLRequestContextGetter* context);
virtual ~ManagedUserRefreshTokenFetcherImpl();
// ManagedUserRefreshTokenFetcher implementation:
@@ -89,6 +90,7 @@ class ManagedUserRefreshTokenFetcherImpl
void DispatchGoogleServiceAuthError(const GoogleServiceAuthError& error,
const std::string& token);
OAuth2TokenService* oauth2_token_service_;
+ std::string account_id_;
URLRequestContextGetter* context_;
std::string device_name_;
@@ -104,8 +106,10 @@ class ManagedUserRefreshTokenFetcherImpl
ManagedUserRefreshTokenFetcherImpl::ManagedUserRefreshTokenFetcherImpl(
OAuth2TokenService* oauth2_token_service,
+ const std::string& account_id,
URLRequestContextGetter* context)
: oauth2_token_service_(oauth2_token_service),
+ account_id_(account_id),
context_(context),
access_token_expired_(false) {}
@@ -125,7 +129,8 @@ void ManagedUserRefreshTokenFetcherImpl::Start(
void ManagedUserRefreshTokenFetcherImpl::StartFetching() {
OAuth2TokenService::ScopeSet scopes;
scopes.insert(GaiaUrls::GetInstance()->oauth1_login_scope());
- access_token_request_ = oauth2_token_service_->StartRequest(scopes, this);
+ access_token_request_ = oauth2_token_service_->StartRequest(
+ account_id_, scopes, this);
}
void ManagedUserRefreshTokenFetcherImpl::OnGetTokenSuccess(
@@ -265,9 +270,11 @@ void ManagedUserRefreshTokenFetcherImpl::DispatchGoogleServiceAuthError(
// static
scoped_ptr<ManagedUserRefreshTokenFetcher>
ManagedUserRefreshTokenFetcher::Create(OAuth2TokenService* oauth2_token_service,
+ const std::string& account_id,
URLRequestContextGetter* context) {
scoped_ptr<ManagedUserRefreshTokenFetcher> fetcher(
- new ManagedUserRefreshTokenFetcherImpl(oauth2_token_service, context));
+ new ManagedUserRefreshTokenFetcherImpl(oauth2_token_service, account_id,
+ context));
return fetcher.Pass();
}

Powered by Google App Engine
This is Rietveld 408576698