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

Side by Side Diff: chrome/browser/sync/supervised_user_signin_manager_wrapper.cc

Issue 2468723003: Move session service and supervised users to buildflags. (Closed)
Patch Set: Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
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/supervised_user_signin_manager_wrapper.h" 5 #include "chrome/browser/sync/supervised_user_signin_manager_wrapper.h"
6 6
7 #include "chrome/browser/profiles/profile.h" 7 #include "chrome/browser/profiles/profile.h"
8 #include "chrome/common/features.h"
8 #include "components/signin/core/browser/signin_manager_base.h" 9 #include "components/signin/core/browser/signin_manager_base.h"
9 #include "google_apis/gaia/gaia_constants.h" 10 #include "google_apis/gaia/gaia_constants.h"
10 11
11 #if defined(ENABLE_SUPERVISED_USERS) 12 #if BUILDFLAG(ENABLE_SUPERVISED_USERS)
12 #include "chrome/browser/supervised_user/supervised_user_constants.h" 13 #include "chrome/browser/supervised_user/supervised_user_constants.h"
13 #endif 14 #endif
14 15
15 SupervisedUserSigninManagerWrapper::SupervisedUserSigninManagerWrapper( 16 SupervisedUserSigninManagerWrapper::SupervisedUserSigninManagerWrapper(
16 Profile* profile, 17 Profile* profile,
17 SigninManagerBase* original) 18 SigninManagerBase* original)
18 : SigninManagerWrapper(original), profile_(profile) {} 19 : SigninManagerWrapper(original), profile_(profile) {}
19 20
20 SupervisedUserSigninManagerWrapper::~SupervisedUserSigninManagerWrapper() {} 21 SupervisedUserSigninManagerWrapper::~SupervisedUserSigninManagerWrapper() {}
21 22
22 std::string SupervisedUserSigninManagerWrapper::GetEffectiveUsername() const { 23 std::string SupervisedUserSigninManagerWrapper::GetEffectiveUsername() const {
23 #if defined(ENABLE_SUPERVISED_USERS) 24 #if BUILDFLAG(ENABLE_SUPERVISED_USERS)
24 if (profile_->IsLegacySupervised()) 25 if (profile_->IsLegacySupervised())
25 return supervised_users::kSupervisedUserPseudoEmail; 26 return supervised_users::kSupervisedUserPseudoEmail;
26 #endif 27 #endif
27 return SigninManagerWrapper::GetEffectiveUsername(); 28 return SigninManagerWrapper::GetEffectiveUsername();
28 } 29 }
29 30
30 std::string SupervisedUserSigninManagerWrapper::GetAccountIdToUse() const { 31 std::string SupervisedUserSigninManagerWrapper::GetAccountIdToUse() const {
31 #if defined(ENABLE_SUPERVISED_USERS) 32 #if BUILDFLAG(ENABLE_SUPERVISED_USERS)
32 if (profile_->IsLegacySupervised()) 33 if (profile_->IsLegacySupervised())
33 return supervised_users::kSupervisedUserPseudoEmail; 34 return supervised_users::kSupervisedUserPseudoEmail;
34 #endif 35 #endif
35 return SigninManagerWrapper::GetAccountIdToUse(); 36 return SigninManagerWrapper::GetAccountIdToUse();
36 } 37 }
37 38
38 std::string SupervisedUserSigninManagerWrapper::GetSyncScopeToUse() const { 39 std::string SupervisedUserSigninManagerWrapper::GetSyncScopeToUse() const {
39 #if defined(ENABLE_SUPERVISED_USERS) 40 #if BUILDFLAG(ENABLE_SUPERVISED_USERS)
40 if (profile_->IsLegacySupervised()) 41 if (profile_->IsLegacySupervised())
41 return GaiaConstants::kChromeSyncSupervisedOAuth2Scope; 42 return GaiaConstants::kChromeSyncSupervisedOAuth2Scope;
42 #endif 43 #endif
43 return SigninManagerWrapper::GetSyncScopeToUse(); 44 return SigninManagerWrapper::GetSyncScopeToUse();
44 } 45 }
OLDNEW
« no previous file with comments | « chrome/browser/sync/sessions/notification_service_sessions_router.cc ('k') | chrome/browser/themes/theme_properties.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698