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

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 bbc69cf44c34338feb2eb2fd713f4db38b426dd3..17c3c551ef714a17f9a047f87842037f9c43f512 100644
--- a/chrome/browser/sync/profile_sync_service.cc
+++ b/chrome/browser/sync/profile_sync_service.cc
@@ -120,6 +120,9 @@ static const char* kOAuth2Scopes[] = {
GaiaConstants::kGoogleTalkOAuth2Scope
};
+static const char* kManagedOAuth2Scopes[] = {
+ GaiaConstants::kChromeSyncManagedOAuth2Scope
+};
static const char* kSyncUnrecoverableErrorHistogram =
"Sync.UnrecoverableErrors";
@@ -1923,8 +1926,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]);
+ }
+
pavely 2013/06/17 22:36:31 Currently access token is passed to both sync serv
Bernhard Bauer 2013/06/18 13:44:35 Hm, true. I did notice this when testing and worke
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