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

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

Issue 787803002: Cleanup: remove SupervisedUserService::IsChildAccount. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 4ab34adfc86c04b91fcdbf0691d44ac8807c8566..014e94adc32c6b40ba86cad28b4366f8741ac19b 100644
--- a/chrome/browser/supervised_user/child_accounts/child_account_service.cc
+++ b/chrome/browser/supervised_user/child_accounts/child_account_service.cc
@@ -45,7 +45,7 @@ void ChildAccountService::Init() {
SigninManagerFactory::GetForProfile(profile_)->AddObserver(this);
SupervisedUserServiceFactory::GetForProfile(profile_)->SetDelegate(this);
- PropagateChildStatusToUser(IsChildAccount());
+ PropagateChildStatusToUser(profile_->IsChild());
// If we're already signed in, fetch the flag again just to be sure.
// (Previously, the browser might have been closed before we got the flag.
@@ -65,13 +65,8 @@ void ChildAccountService::Shutdown() {
SigninManagerFactory::GetForProfile(profile_)->RemoveObserver(this);
}
-bool ChildAccountService::IsChildAccount() const {
- return profile_->GetPrefs()->GetString(prefs::kSupervisedUserId) ==
- supervised_users::kChildAccountSUID;
-}
-
bool ChildAccountService::SetActive(bool active) {
- if (!IsChildAccount() && !active_)
+ if (!profile_->IsChild() && !active_)
return false;
if (active_ == active)
return true;
@@ -173,7 +168,7 @@ void ChildAccountService::GoogleSigninSucceeded(const std::string& account_id,
void ChildAccountService::GoogleSignedOut(const std::string& account_id,
const std::string& username) {
- DCHECK(!IsChildAccount());
+ DCHECK(!profile_->IsChild());
CancelFetchingServiceFlags();
}
@@ -253,7 +248,7 @@ void ChildAccountService::OnFlagsFetched(
}
void ChildAccountService::SetIsChildAccount(bool is_child_account) {
- if (IsChildAccount() == is_child_account)
+ if (profile_->IsChild() == is_child_account)
return;
if (is_child_account) {

Powered by Google App Engine
This is Rietveld 408576698