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

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: sync 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 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.

Powered by Google App Engine
This is Rietveld 408576698