Chromium Code Reviews| 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 |