Chromium Code Reviews| Index: chrome/browser/supervised_user/child_accounts/child_account_service.h |
| diff --git a/chrome/browser/supervised_user/child_accounts/child_account_service.h b/chrome/browser/supervised_user/child_accounts/child_account_service.h |
| index 4a1519670d151ea72d94199ac39cda71cf43e7db..270f00b2a7067fc735064a3e6f03bdea9d94bbac 100644 |
| --- a/chrome/browser/supervised_user/child_accounts/child_account_service.h |
| +++ b/chrome/browser/supervised_user/child_accounts/child_account_service.h |
| @@ -11,8 +11,10 @@ |
| #include "base/macros.h" |
| #include "base/memory/scoped_ptr.h" |
| #include "base/memory/weak_ptr.h" |
| +#include "base/observer_list.h" |
| #include "base/time/time.h" |
| #include "base/timer/timer.h" |
| +#include "chrome/browser/supervised_user/child_accounts/child_account_status_observer.h" |
| #include "chrome/browser/supervised_user/child_accounts/family_info_fetcher.h" |
| #include "chrome/browser/supervised_user/supervised_user_service.h" |
| #include "components/keyed_service/core/keyed_service.h" |
| @@ -36,6 +38,12 @@ class ChildAccountService : public KeyedService, |
| public: |
| ~ChildAccountService() override; |
| + enum ChildAccountStatus { |
| + CHILD, |
| + NON_CHILD, |
| + UNKNOWN |
| + }; |
| + |
| void Init(); |
| // Sets whether the signed-in account is a child account. |
| @@ -43,9 +51,15 @@ class ChildAccountService : public KeyedService, |
| // happens outside of this class (like Android). |
| void SetIsChildAccount(bool is_child_account); |
| + bool IsChildAccountStatusKnown(); |
| + |
| // KeyedService: |
| void Shutdown() override; |
| + // Adds/removes observer. |
| + void AddStatusObserver(ChildAccountStatusObserver* observer); |
| + void RemoveStatusObserver(ChildAccountStatusObserver* observer); |
| + |
| private: |
| friend class ChildAccountServiceFactory; |
| // Use |ChildAccountServiceFactory::GetForProfile(...)| to get an instance of |
| @@ -109,6 +123,10 @@ class ChildAccountService : public KeyedService, |
| base::OneShotTimer<ChildAccountService> family_fetch_timer_; |
| net::BackoffEntry family_fetch_backoff_; |
| + ChildAccountStatus account_status_; |
|
Marc Treib
2015/03/04 16:31:48
Hm, I think this is actually only used to decide U
merkulova
2015/03/04 19:06:49
removed. Moved to pref.
|
| + |
| + ObserverList<ChildAccountStatusObserver> observer_list_; |
| + |
| base::WeakPtrFactory<ChildAccountService> weak_ptr_factory_; |
| DISALLOW_COPY_AND_ASSIGN(ChildAccountService); |