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

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

Issue 281433004: Cleanup: Pull Managed User logic out of ProfileSyncService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 unified diff | Download patch | Annotate | Revision Log
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/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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/sync/managed_user_signin_manager_wrapper.h ('k') | chrome/browser/sync/profile_sync_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698