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 #ifndef CHROME_BROWSER_SUPERVISED_USER_CHILD_ACCOUNTS_CHILD_ACCOUNT_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_SUPERVISED_USER_CHILD_ACCOUNTS_CHILD_ACCOUNT_SERVICE_H_ |
6 #define CHROME_BROWSER_SUPERVISED_USER_CHILD_ACCOUNTS_CHILD_ACCOUNT_SERVICE_H_ | 6 #define CHROME_BROWSER_SUPERVISED_USER_CHILD_ACCOUNTS_CHILD_ACCOUNT_SERVICE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 18 matching lines...) Expand all Loading... |
29 // This class handles detection of child accounts (on sign-in as well as on | 29 // This class handles detection of child accounts (on sign-in as well as on |
30 // browser restart), and triggers the appropriate behavior (e.g. enable the | 30 // browser restart), and triggers the appropriate behavior (e.g. enable the |
31 // supervised user experience, fetch information about the parent(s)). | 31 // supervised user experience, fetch information about the parent(s)). |
32 class ChildAccountService : public KeyedService, | 32 class ChildAccountService : public KeyedService, |
33 public FamilyInfoFetcher::Consumer, | 33 public FamilyInfoFetcher::Consumer, |
34 public SigninManagerBase::Observer, | 34 public SigninManagerBase::Observer, |
35 public SupervisedUserService::Delegate { | 35 public SupervisedUserService::Delegate { |
36 public: | 36 public: |
37 ~ChildAccountService() override; | 37 ~ChildAccountService() override; |
38 | 38 |
| 39 static bool IsChildAccountDetectionEnabled(); |
| 40 |
39 void Init(); | 41 void Init(); |
40 | 42 |
41 // Sets whether the signed-in account is a child account. | 43 // Sets whether the signed-in account is a child account. |
42 // Public so it can be called on platforms where child account detection | 44 // Public so it can be called on platforms where child account detection |
43 // happens outside of this class (like Android). | 45 // happens outside of this class (like Android). |
44 void SetIsChildAccount(bool is_child_account); | 46 void SetIsChildAccount(bool is_child_account); |
45 | 47 |
46 // KeyedService: | 48 // KeyedService: |
47 void Shutdown() override; | 49 void Shutdown() override; |
48 | 50 |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 // If fetching the family info fails, retry with exponential backoff. | 110 // If fetching the family info fails, retry with exponential backoff. |
109 base::OneShotTimer<ChildAccountService> family_fetch_timer_; | 111 base::OneShotTimer<ChildAccountService> family_fetch_timer_; |
110 net::BackoffEntry family_fetch_backoff_; | 112 net::BackoffEntry family_fetch_backoff_; |
111 | 113 |
112 base::WeakPtrFactory<ChildAccountService> weak_ptr_factory_; | 114 base::WeakPtrFactory<ChildAccountService> weak_ptr_factory_; |
113 | 115 |
114 DISALLOW_COPY_AND_ASSIGN(ChildAccountService); | 116 DISALLOW_COPY_AND_ASSIGN(ChildAccountService); |
115 }; | 117 }; |
116 | 118 |
117 #endif // CHROME_BROWSER_SUPERVISED_USER_CHILD_ACCOUNTS_CHILD_ACCOUNT_SERVICE_H
_ | 119 #endif // CHROME_BROWSER_SUPERVISED_USER_CHILD_ACCOUNTS_CHILD_ACCOUNT_SERVICE_H
_ |
OLD | NEW |