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

Unified Diff: chrome/browser/chromeos/settings/device_oauth2_token_service.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: Fixing a bug affecting ProfileSyncService and CR comments. 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/chromeos/settings/device_oauth2_token_service.cc
diff --git a/chrome/browser/chromeos/settings/device_oauth2_token_service.cc b/chrome/browser/chromeos/settings/device_oauth2_token_service.cc
index dbcf249e6bfabd215da76c1820a98f90a623d62f..6a92407f1b31528de76287f756d497db645284e6 100644
--- a/chrome/browser/chromeos/settings/device_oauth2_token_service.cc
+++ b/chrome/browser/chromeos/settings/device_oauth2_token_service.cc
@@ -115,7 +115,7 @@ void DeviceOAuth2TokenService::ValidatingConsumer::StartValidation(
gaia_oauth_client_->RefreshToken(
client_info,
- token_service_->GetRefreshToken(),
+ token_service_->GetRefreshToken(std::string()),
std::vector<std::string>(1, kServiceScopeGetUserInfo),
token_service_->max_refresh_token_validation_retries_,
this);
@@ -221,18 +221,21 @@ DeviceOAuth2TokenService::~DeviceOAuth2TokenService() {
}
scoped_ptr<OAuth2TokenService::Request> DeviceOAuth2TokenService::StartRequest(
+ const std::string& account_id,
const OAuth2TokenService::ScopeSet& scopes,
OAuth2TokenService::Consumer* consumer) {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
+ DCHECK(account_id.empty());
if (refresh_token_is_valid_) {
- return OAuth2TokenService::StartRequest(scopes, consumer).Pass();
+ return OAuth2TokenService::StartRequest(
+ account_id, scopes, consumer).Pass();
} else {
scoped_ptr<ValidatingConsumer> validating_consumer(
new ValidatingConsumer(this, consumer));
scoped_ptr<Request> request = OAuth2TokenService::StartRequest(
- scopes, validating_consumer.get());
+ account_id, scopes, validating_consumer.get());
Andrew T Wilson (Slow) 2013/08/30 10:47:00 Yeah, this stuff needs to be moved to FetchOAuth2T
fgorski 2013/08/30 20:10:16 crbug.com/282454. There is the aspect of validatio
validating_consumer->StartValidation(request.Pass());
return validating_consumer.PassAs<Request>();
}
@@ -260,7 +263,9 @@ void DeviceOAuth2TokenService::SetAndSaveRefreshToken(
encrypted_refresh_token);
}
-std::string DeviceOAuth2TokenService::GetRefreshToken() {
+std::string DeviceOAuth2TokenService::GetRefreshToken(
+ const std::string& account_id) {
+ DCHECK(account_id.empty());
if (refresh_token_.empty()) {
std::string encrypted_refresh_token =
local_state_->GetString(prefs::kDeviceRobotAnyApiRefreshToken);

Powered by Google App Engine
This is Rietveld 408576698