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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 if (active_ == active) | 138 if (active_ == active) |
139 return true; | 139 return true; |
140 active_ = active; | 140 active_ = active; |
141 | 141 |
142 if (active_) { | 142 if (active_) { |
143 SupervisedUserSettingsService* settings_service = | 143 SupervisedUserSettingsService* settings_service = |
144 SupervisedUserSettingsServiceFactory::GetForProfile(profile_); | 144 SupervisedUserSettingsServiceFactory::GetForProfile(profile_); |
145 | 145 |
146 settings_service->SetLocalSetting( | 146 settings_service->SetLocalSetting( |
147 supervised_users::kRecordHistoryIncludesSessionSync, | 147 supervised_users::kRecordHistoryIncludesSessionSync, |
148 base::MakeUnique<base::FundamentalValue>(false)); | 148 base::MakeUnique<base::Value>(false)); |
149 | 149 |
150 // In contrast to legacy SUs, child account SUs must sign in. | 150 // In contrast to legacy SUs, child account SUs must sign in. |
151 settings_service->SetLocalSetting( | 151 settings_service->SetLocalSetting(supervised_users::kSigninAllowed, |
152 supervised_users::kSigninAllowed, | 152 base::MakeUnique<base::Value>(true)); |
153 base::MakeUnique<base::FundamentalValue>(true)); | |
154 | 153 |
155 // Always allow cookies, to avoid website compatibility issues. | 154 // Always allow cookies, to avoid website compatibility issues. |
156 settings_service->SetLocalSetting( | 155 settings_service->SetLocalSetting(supervised_users::kCookiesAlwaysAllowed, |
157 supervised_users::kCookiesAlwaysAllowed, | 156 base::MakeUnique<base::Value>(true)); |
158 base::MakeUnique<base::FundamentalValue>(true)); | |
159 | 157 |
160 // SafeSearch is controlled at the account level, so don't override it | 158 // SafeSearch is controlled at the account level, so don't override it |
161 // client-side. | 159 // client-side. |
162 settings_service->SetLocalSetting( | 160 settings_service->SetLocalSetting(supervised_users::kForceSafeSearch, |
163 supervised_users::kForceSafeSearch, | 161 base::MakeUnique<base::Value>(false)); |
164 base::MakeUnique<base::FundamentalValue>(false)); | |
165 | 162 |
166 #if !defined(OS_CHROMEOS) | 163 #if !defined(OS_CHROMEOS) |
167 // This is also used by user policies (UserPolicySigninService), but since | 164 // This is also used by user policies (UserPolicySigninService), but since |
168 // child accounts can not also be Dasher accounts, there shouldn't be any | 165 // child accounts can not also be Dasher accounts, there shouldn't be any |
169 // problems. | 166 // problems. |
170 SigninManagerFactory::GetForProfile(profile_)->ProhibitSignout(true); | 167 SigninManagerFactory::GetForProfile(profile_)->ProhibitSignout(true); |
171 #endif | 168 #endif |
172 | 169 |
173 // TODO(treib): Maybe store the last update time in a pref, so we don't | 170 // TODO(treib): Maybe store the last update time in a pref, so we don't |
174 // have to re-fetch on every start. | 171 // have to re-fetch on every start. |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 } | 348 } |
352 | 349 |
353 void ChildAccountService::ClearSecondCustodianPrefs() { | 350 void ChildAccountService::ClearSecondCustodianPrefs() { |
354 profile_->GetPrefs()->ClearPref(prefs::kSupervisedUserSecondCustodianName); | 351 profile_->GetPrefs()->ClearPref(prefs::kSupervisedUserSecondCustodianName); |
355 profile_->GetPrefs()->ClearPref(prefs::kSupervisedUserSecondCustodianEmail); | 352 profile_->GetPrefs()->ClearPref(prefs::kSupervisedUserSecondCustodianEmail); |
356 profile_->GetPrefs()->ClearPref( | 353 profile_->GetPrefs()->ClearPref( |
357 prefs::kSupervisedUserSecondCustodianProfileURL); | 354 prefs::kSupervisedUserSecondCustodianProfileURL); |
358 profile_->GetPrefs()->ClearPref( | 355 profile_->GetPrefs()->ClearPref( |
359 prefs::kSupervisedUserSecondCustodianProfileImageURL); | 356 prefs::kSupervisedUserSecondCustodianProfileImageURL); |
360 } | 357 } |
OLD | NEW |