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

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

Issue 479353003: Add IsAuthenticated() method to SigninManager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comments Created 6 years, 3 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/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 "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 #include "google_apis/gaia/gaia_constants.h"
10 10
(...skipping 16 matching lines...) Expand all
27 std::string SupervisedUserSigninManagerWrapper::GetEffectiveUsername() const { 27 std::string SupervisedUserSigninManagerWrapper::GetEffectiveUsername() const {
28 const std::string& auth_username = original_->GetAuthenticatedUsername(); 28 const std::string& auth_username = original_->GetAuthenticatedUsername();
29 #if defined(ENABLE_MANAGED_USERS) 29 #if defined(ENABLE_MANAGED_USERS)
30 if (auth_username.empty() && profile_->IsSupervised()) 30 if (auth_username.empty() && profile_->IsSupervised())
31 return supervised_users::kSupervisedUserPseudoEmail; 31 return supervised_users::kSupervisedUserPseudoEmail;
32 #endif 32 #endif
33 return auth_username; 33 return auth_username;
34 } 34 }
35 35
36 std::string SupervisedUserSigninManagerWrapper::GetAccountIdToUse() const { 36 std::string SupervisedUserSigninManagerWrapper::GetAccountIdToUse() const {
37 const std::string& auth_account = original_->GetAuthenticatedAccountId();
38 #if defined(ENABLE_MANAGED_USERS) 37 #if defined(ENABLE_MANAGED_USERS)
39 if (auth_account.empty() && profile_->IsSupervised()) 38 if (!original_->IsAuthenticated() && profile_->IsSupervised())
40 return supervised_users::kSupervisedUserPseudoEmail; 39 return supervised_users::kSupervisedUserPseudoEmail;
41 #endif 40 #endif
42 return auth_account; 41 return original_->GetAuthenticatedAccountId();
43 } 42 }
44 43
45 std::string SupervisedUserSigninManagerWrapper::GetSyncScopeToUse() const { 44 std::string SupervisedUserSigninManagerWrapper::GetSyncScopeToUse() const {
46 #if defined(ENABLE_MANAGED_USERS) 45 #if defined(ENABLE_MANAGED_USERS)
47 const std::string& auth_account = original_->GetAuthenticatedAccountId(); 46 if (!original_->IsAuthenticated() && profile_->IsSupervised())
48 if (auth_account.empty() && profile_->IsSupervised())
49 return GaiaConstants::kChromeSyncSupervisedOAuth2Scope; 47 return GaiaConstants::kChromeSyncSupervisedOAuth2Scope;
50 #endif 48 #endif
51 return GaiaConstants::kChromeSyncOAuth2Scope; 49 return GaiaConstants::kChromeSyncOAuth2Scope;
52 } 50 }
OLDNEW
« no previous file with comments | « chrome/browser/sync/profile_sync_service_startup_unittest.cc ('k') | chrome/browser/sync/sync_ui_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698