OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/sync/managed_user_signin_manager_wrapper.h" | 5 #include "chrome/browser/sync/managed_user_signin_manager_wrapper.h" |
6 | 6 |
7 #include "chrome/browser/profiles/profile.h" | 7 #include "chrome/browser/profiles/profile.h" |
8 #include "components/signin/core/browser/signin_manager_base.h" | 8 #include "components/signin/core/browser/signin_manager_base.h" |
| 9 #include "google_apis/gaia/gaia_constants.h" |
9 | 10 |
10 #if defined(ENABLE_MANAGED_USERS) | 11 #if defined(ENABLE_MANAGED_USERS) |
11 #include "chrome/browser/managed_mode/managed_user_constants.h" | 12 #include "chrome/browser/managed_mode/managed_user_constants.h" |
12 #endif | 13 #endif |
13 | 14 |
14 ManagedUserSigninManagerWrapper::ManagedUserSigninManagerWrapper( | 15 ManagedUserSigninManagerWrapper::ManagedUserSigninManagerWrapper( |
15 Profile* profile, | 16 Profile* profile, |
16 SigninManagerBase* original) | 17 SigninManagerBase* original) |
17 : profile_(profile), original_(original) {} | 18 : profile_(profile), original_(original) {} |
18 | 19 |
(...skipping 14 matching lines...) Expand all Loading... |
33 } | 34 } |
34 | 35 |
35 std::string ManagedUserSigninManagerWrapper::GetAccountIdToUse() const { | 36 std::string ManagedUserSigninManagerWrapper::GetAccountIdToUse() const { |
36 const std::string& auth_account = original_->GetAuthenticatedAccountId(); | 37 const std::string& auth_account = original_->GetAuthenticatedAccountId(); |
37 #if defined(ENABLE_MANAGED_USERS) | 38 #if defined(ENABLE_MANAGED_USERS) |
38 if (auth_account.empty() && profile_->IsManaged()) | 39 if (auth_account.empty() && profile_->IsManaged()) |
39 return managed_users::kManagedUserPseudoEmail; | 40 return managed_users::kManagedUserPseudoEmail; |
40 #endif | 41 #endif |
41 return auth_account; | 42 return auth_account; |
42 } | 43 } |
| 44 |
| 45 std::string ManagedUserSigninManagerWrapper::GetSyncScopeToUse() const { |
| 46 #if defined(ENABLE_MANAGED_USERS) |
| 47 const std::string& auth_account = original_->GetAuthenticatedAccountId(); |
| 48 if (auth_account.empty() && profile_->IsManaged()) |
| 49 return GaiaConstants::kChromeSyncManagedOAuth2Scope; |
| 50 #endif |
| 51 return GaiaConstants::kChromeSyncOAuth2Scope; |
| 52 } |
OLD | NEW |