| 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 void ScheduleNextStatusFlagUpdate(base::TimeDelta delay); | 96 void ScheduleNextStatusFlagUpdate(base::TimeDelta delay); |
| 97 | 97 |
| 98 void PropagateChildStatusToUser(bool is_child); | 98 void PropagateChildStatusToUser(bool is_child); |
| 99 | 99 |
| 100 void SetFirstCustodianPrefs(const FamilyInfoFetcher::FamilyMember& custodian); | 100 void SetFirstCustodianPrefs(const FamilyInfoFetcher::FamilyMember& custodian); |
| 101 void SetSecondCustodianPrefs( | 101 void SetSecondCustodianPrefs( |
| 102 const FamilyInfoFetcher::FamilyMember& custodian); | 102 const FamilyInfoFetcher::FamilyMember& custodian); |
| 103 void ClearFirstCustodianPrefs(); | 103 void ClearFirstCustodianPrefs(); |
| 104 void ClearSecondCustodianPrefs(); | 104 void ClearSecondCustodianPrefs(); |
| 105 | 105 |
| 106 void EnableExperimentalFiltering(); | |
| 107 | |
| 108 // Owns us via the KeyedService mechanism. | 106 // Owns us via the KeyedService mechanism. |
| 109 Profile* profile_; | 107 Profile* profile_; |
| 110 | 108 |
| 111 bool active_; | 109 bool active_; |
| 112 | 110 |
| 113 // The user for which we are currently trying to fetch the child account flag. | 111 // The user for which we are currently trying to fetch the child account flag. |
| 114 // Empty when we are not currently fetching. | 112 // Empty when we are not currently fetching. |
| 115 std::string account_id_; | 113 std::string account_id_; |
| 116 | 114 |
| 117 scoped_ptr<AccountServiceFlagFetcher> flag_fetcher_; | 115 scoped_ptr<AccountServiceFlagFetcher> flag_fetcher_; |
| 118 // If fetching the account service flag fails, retry with exponential backoff. | 116 // If fetching the account service flag fails, retry with exponential backoff. |
| 119 base::OneShotTimer<ChildAccountService> flag_fetch_timer_; | 117 base::OneShotTimer<ChildAccountService> flag_fetch_timer_; |
| 120 net::BackoffEntry flag_fetch_backoff_; | 118 net::BackoffEntry flag_fetch_backoff_; |
| 121 | 119 |
| 122 scoped_ptr<FamilyInfoFetcher> family_fetcher_; | 120 scoped_ptr<FamilyInfoFetcher> family_fetcher_; |
| 123 // If fetching the family info fails, retry with exponential backoff. | 121 // If fetching the family info fails, retry with exponential backoff. |
| 124 base::OneShotTimer<ChildAccountService> family_fetch_timer_; | 122 base::OneShotTimer<ChildAccountService> family_fetch_timer_; |
| 125 net::BackoffEntry family_fetch_backoff_; | 123 net::BackoffEntry family_fetch_backoff_; |
| 126 | 124 |
| 127 // Callbacks to run when the user status becomes known. | 125 // Callbacks to run when the user status becomes known. |
| 128 std::vector<base::Closure> status_received_callback_list_; | 126 std::vector<base::Closure> status_received_callback_list_; |
| 129 | 127 |
| 130 base::WeakPtrFactory<ChildAccountService> weak_ptr_factory_; | 128 base::WeakPtrFactory<ChildAccountService> weak_ptr_factory_; |
| 131 | 129 |
| 132 DISALLOW_COPY_AND_ASSIGN(ChildAccountService); | 130 DISALLOW_COPY_AND_ASSIGN(ChildAccountService); |
| 133 }; | 131 }; |
| 134 | 132 |
| 135 #endif // CHROME_BROWSER_SUPERVISED_USER_CHILD_ACCOUNTS_CHILD_ACCOUNT_SERVICE_H
_ | 133 #endif // CHROME_BROWSER_SUPERVISED_USER_CHILD_ACCOUNTS_CHILD_ACCOUNT_SERVICE_H
_ |
| OLD | NEW |