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
3 // found in the LICENSE file.
5 #include "chrome/browser/sync/managed_user_signin_manager_wrapper.h"
7 #include "chrome/browser/profiles/profile.h"
8 #include "components/signin/core/browser/signin_manager_base.h"
10 #if defined(ENABLE_MANAGED_USERS)
11 #include "chrome/browser/managed_mode/managed_user_constants.h"
14 ManagedUserSigninManagerWrapper::ManagedUserSigninManagerWrapper(
16 SigninManagerBase
* original
)
17 : profile_(profile
), original_(original
) {}
19 ManagedUserSigninManagerWrapper::~ManagedUserSigninManagerWrapper() {
22 SigninManagerBase
* ManagedUserSigninManagerWrapper::GetOriginal() {
26 std::string
ManagedUserSigninManagerWrapper::GetEffectiveUsername() const {
27 if (profile_
->IsManaged()) {
28 #if defined(ENABLE_MANAGED_USERS)
29 DCHECK_EQ(std::string(), original_
->GetAuthenticatedUsername());
30 return managed_users::kManagedUserPseudoEmail
;
36 return original_
->GetAuthenticatedUsername();
39 std::string
ManagedUserSigninManagerWrapper::GetAccountIdToUse() const {
40 if (profile_
->IsManaged()) {
41 #if defined(ENABLE_MANAGED_USERS)
42 return managed_users::kManagedUserPseudoEmail
;
48 return original_
->GetAuthenticatedAccountId();