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

Unified Diff: chrome/browser/sync/profile_sync_service.cc

Issue 15780020: Setup Sync to use OAuth token for managed users. (Closed) Base URL: http://git.chromium.org/chromium/src.git@issue226464a
Patch Set: review Created 7 years, 6 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/sync/profile_sync_service.cc
diff --git a/chrome/browser/sync/profile_sync_service.cc b/chrome/browser/sync/profile_sync_service.cc
index 277c9e3eee885bd7f1b19e669f4c277378f2977f..5e1cb3c68448049fe2aba5a48e1e8a21cee3c71f 100644
--- a/chrome/browser/sync/profile_sync_service.cc
+++ b/chrome/browser/sync/profile_sync_service.cc
@@ -119,6 +119,9 @@ static const char* kOAuth2Scopes[] = {
GaiaConstants::kGoogleTalkOAuth2Scope
};
+static const char* kManagedOAuth2Scopes[] = {
+ GaiaConstants::kChromeSyncManagedOAuth2Scope
+};
static const char* kSyncUnrecoverableErrorHistogram =
"Sync.UnrecoverableErrors";
@@ -1896,8 +1899,14 @@ void ProfileSyncService::RequestAccessToken() {
return;
request_access_token_retry_timer_.Stop();
OAuth2TokenService::ScopeSet oauth2_scopes;
- for (size_t i = 0; i < arraysize(kOAuth2Scopes); i++)
- oauth2_scopes.insert(kOAuth2Scopes[i]);
+ if (ManagedUserService::ProfileIsManaged(profile_)) {
+ for (size_t i = 0; i < arraysize(kManagedOAuth2Scopes); i++)
+ oauth2_scopes.insert(kManagedOAuth2Scopes[i]);
+ } else {
+ for (size_t i = 0; i < arraysize(kOAuth2Scopes); i++)
+ oauth2_scopes.insert(kOAuth2Scopes[i]);
+ }
+
OAuth2TokenService* token_service =
ProfileOAuth2TokenServiceFactory::GetForProfile(profile_);
// Invalidate previous token, otherwise token service will return the same

Powered by Google App Engine
This is Rietveld 408576698