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

Unified Diff: chrome/browser/supervised_user/child_accounts/child_account_service.cc

Issue 789853002: Add support for child accounts on Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: x Created 6 years 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 side-by-side diff with in-line comments
Download patch
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 c6a4ed29f149f677c111c806c47d343df99e661d..4ec21164548f7dd78fb3efc528842aae0160fbb6 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)
user_manager::User* user =

Powered by Google App Engine
This is Rietveld 408576698