| OLD | NEW |
| 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/supervised_user/child_accounts/child_account_service.h" | 5 #include "chrome/browser/supervised_user/child_accounts/child_account_service.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/feature_list.h" | 9 #include "base/feature_list.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 if (active_ == active) | 142 if (active_ == active) |
| 143 return true; | 143 return true; |
| 144 active_ = active; | 144 active_ = active; |
| 145 | 145 |
| 146 if (active_) { | 146 if (active_) { |
| 147 SupervisedUserSettingsService* settings_service = | 147 SupervisedUserSettingsService* settings_service = |
| 148 SupervisedUserSettingsServiceFactory::GetForProfile(profile_); | 148 SupervisedUserSettingsServiceFactory::GetForProfile(profile_); |
| 149 | 149 |
| 150 settings_service->SetLocalSetting( | 150 settings_service->SetLocalSetting( |
| 151 supervised_users::kRecordHistoryIncludesSessionSync, | 151 supervised_users::kRecordHistoryIncludesSessionSync, |
| 152 base::WrapUnique(new base::FundamentalValue(false))); | 152 base::MakeUnique<base::FundamentalValue>(false)); |
| 153 | 153 |
| 154 // In contrast to legacy SUs, child account SUs must sign in. | 154 // In contrast to legacy SUs, child account SUs must sign in. |
| 155 settings_service->SetLocalSetting( | 155 settings_service->SetLocalSetting( |
| 156 supervised_users::kSigninAllowed, | 156 supervised_users::kSigninAllowed, |
| 157 base::WrapUnique(new base::FundamentalValue(true))); | 157 base::MakeUnique<base::FundamentalValue>(true)); |
| 158 | 158 |
| 159 // SafeSearch is controlled at the account level, so don't override it | 159 // SafeSearch is controlled at the account level, so don't override it |
| 160 // client-side. | 160 // client-side. |
| 161 settings_service->SetLocalSetting( | 161 settings_service->SetLocalSetting( |
| 162 supervised_users::kForceSafeSearch, | 162 supervised_users::kForceSafeSearch, |
| 163 base::WrapUnique(new base::FundamentalValue(false))); | 163 base::MakeUnique<base::FundamentalValue>(false)); |
| 164 | 164 |
| 165 #if !defined(OS_CHROMEOS) | 165 #if !defined(OS_CHROMEOS) |
| 166 // This is also used by user policies (UserPolicySigninService), but since | 166 // This is also used by user policies (UserPolicySigninService), but since |
| 167 // child accounts can not also be Dasher accounts, there shouldn't be any | 167 // child accounts can not also be Dasher accounts, there shouldn't be any |
| 168 // problems. | 168 // problems. |
| 169 SigninManagerFactory::GetForProfile(profile_)->ProhibitSignout(true); | 169 SigninManagerFactory::GetForProfile(profile_)->ProhibitSignout(true); |
| 170 #endif | 170 #endif |
| 171 | 171 |
| 172 // TODO(treib): Maybe store the last update time in a pref, so we don't | 172 // TODO(treib): Maybe store the last update time in a pref, so we don't |
| 173 // have to re-fetch on every start. | 173 // have to re-fetch on every start. |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 } | 339 } |
| 340 | 340 |
| 341 void ChildAccountService::ClearSecondCustodianPrefs() { | 341 void ChildAccountService::ClearSecondCustodianPrefs() { |
| 342 profile_->GetPrefs()->ClearPref(prefs::kSupervisedUserSecondCustodianName); | 342 profile_->GetPrefs()->ClearPref(prefs::kSupervisedUserSecondCustodianName); |
| 343 profile_->GetPrefs()->ClearPref(prefs::kSupervisedUserSecondCustodianEmail); | 343 profile_->GetPrefs()->ClearPref(prefs::kSupervisedUserSecondCustodianEmail); |
| 344 profile_->GetPrefs()->ClearPref( | 344 profile_->GetPrefs()->ClearPref( |
| 345 prefs::kSupervisedUserSecondCustodianProfileURL); | 345 prefs::kSupervisedUserSecondCustodianProfileURL); |
| 346 profile_->GetPrefs()->ClearPref( | 346 profile_->GetPrefs()->ClearPref( |
| 347 prefs::kSupervisedUserSecondCustodianProfileImageURL); | 347 prefs::kSupervisedUserSecondCustodianProfileImageURL); |
| 348 } | 348 } |
| OLD | NEW |