| Index: chrome/browser/supervised_user/child_accounts/child_account_service.cc
|
| diff --git a/chrome/browser/supervised_user/child_accounts/child_account_service.cc b/chrome/browser/supervised_user/child_accounts/child_account_service.cc
|
| index 95ee22533d173017bf3bac3d3d3ffc758a3e4fad..56b611e0500c26ca3a3a7dc74ccab88f581607f6 100644
|
| --- a/chrome/browser/supervised_user/child_accounts/child_account_service.cc
|
| +++ b/chrome/browser/supervised_user/child_accounts/child_account_service.cc
|
| @@ -42,6 +42,19 @@ ChildAccountService::ChildAccountService(Profile* profile)
|
|
|
| ChildAccountService::~ChildAccountService() {}
|
|
|
| +void ChildAccountService::SetIsChildAccount(bool is_child_account) {
|
| + if (profile_->IsChild() == is_child_account)
|
| + return;
|
| +
|
| + if (is_child_account) {
|
| + profile_->GetPrefs()->SetString(prefs::kSupervisedUserId,
|
| + supervised_users::kChildAccountSUID);
|
| + } else {
|
| + profile_->GetPrefs()->ClearPref(prefs::kSupervisedUserId);
|
| + }
|
| + PropagateChildStatusToUser(is_child_account);
|
| +}
|
| +
|
| void ChildAccountService::Init() {
|
| SigninManagerFactory::GetForProfile(profile_)->AddObserver(this);
|
| SupervisedUserServiceFactory::GetForProfile(profile_)->SetDelegate(this);
|
| @@ -236,19 +249,6 @@ void ChildAccountService::OnFlagsFetched(
|
| SetIsChildAccount(is_child_account);
|
| }
|
|
|
| -void ChildAccountService::SetIsChildAccount(bool is_child_account) {
|
| - if (profile_->IsChild() == is_child_account)
|
| - return;
|
| -
|
| - if (is_child_account) {
|
| - profile_->GetPrefs()->SetString(prefs::kSupervisedUserId,
|
| - supervised_users::kChildAccountSUID);
|
| - } else {
|
| - profile_->GetPrefs()->ClearPref(prefs::kSupervisedUserId);
|
| - }
|
| - PropagateChildStatusToUser(is_child_account);
|
| -}
|
| -
|
| void ChildAccountService::PropagateChildStatusToUser(bool is_child) {
|
| #if defined(OS_CHROMEOS)
|
| // TODO(merkulova,treib): Figure out why this causes tests to fail.
|
|
|