| 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 const std::string& username, | 63 const std::string& username, |
| 64 const std::string& password) override; | 64 const std::string& password) override; |
| 65 void GoogleSignedOut(const std::string& account_id, | 65 void GoogleSignedOut(const std::string& account_id, |
| 66 const std::string& username) override; | 66 const std::string& username) override; |
| 67 | 67 |
| 68 // FamilyInfoFetcher::Consumer implementation. | 68 // FamilyInfoFetcher::Consumer implementation. |
| 69 void OnGetFamilyMembersSuccess( | 69 void OnGetFamilyMembersSuccess( |
| 70 const std::vector<FamilyInfoFetcher::FamilyMember>& members) override; | 70 const std::vector<FamilyInfoFetcher::FamilyMember>& members) override; |
| 71 void OnFailure(FamilyInfoFetcher::ErrorCode error) override; | 71 void OnFailure(FamilyInfoFetcher::ErrorCode error) override; |
| 72 | 72 |
| 73 void StartFetchingFamilyInfo(); |
| 74 void CancelFetchingFamilyInfo(); |
| 75 void ScheduleNextFamilyInfoUpdate(base::TimeDelta delay); |
| 76 |
| 73 void StartFetchingServiceFlags(); | 77 void StartFetchingServiceFlags(); |
| 74 void CancelFetchingServiceFlags(); | 78 void CancelFetchingServiceFlags(); |
| 75 void OnFlagsFetched(AccountServiceFlagFetcher::ResultCode, | 79 void OnFlagsFetched(AccountServiceFlagFetcher::ResultCode, |
| 76 const std::vector<std::string>& flags); | 80 const std::vector<std::string>& flags); |
| 77 void ScheduleNextStatusFlagUpdate(base::TimeDelta delay); | 81 void ScheduleNextStatusFlagUpdate(base::TimeDelta delay); |
| 78 | 82 |
| 79 void PropagateChildStatusToUser(bool is_child); | 83 void PropagateChildStatusToUser(bool is_child); |
| 80 | 84 |
| 81 void SetFirstCustodianPrefs(const FamilyInfoFetcher::FamilyMember& custodian); | 85 void SetFirstCustodianPrefs(const FamilyInfoFetcher::FamilyMember& custodian); |
| 82 void SetSecondCustodianPrefs( | 86 void SetSecondCustodianPrefs( |
| (...skipping 11 matching lines...) Expand all Loading... |
| 94 // The user for which we are currently trying to fetch the child account flag. | 98 // The user for which we are currently trying to fetch the child account flag. |
| 95 // Empty when we are not currently fetching. | 99 // Empty when we are not currently fetching. |
| 96 std::string account_id_; | 100 std::string account_id_; |
| 97 | 101 |
| 98 scoped_ptr<AccountServiceFlagFetcher> flag_fetcher_; | 102 scoped_ptr<AccountServiceFlagFetcher> flag_fetcher_; |
| 99 // If fetching the account service flag fails, retry with exponential backoff. | 103 // If fetching the account service flag fails, retry with exponential backoff. |
| 100 base::OneShotTimer<ChildAccountService> flag_fetch_timer_; | 104 base::OneShotTimer<ChildAccountService> flag_fetch_timer_; |
| 101 net::BackoffEntry flag_fetch_backoff_; | 105 net::BackoffEntry flag_fetch_backoff_; |
| 102 | 106 |
| 103 scoped_ptr<FamilyInfoFetcher> family_fetcher_; | 107 scoped_ptr<FamilyInfoFetcher> family_fetcher_; |
| 108 // If fetching the family info fails, retry with exponential backoff. |
| 109 base::OneShotTimer<ChildAccountService> family_fetch_timer_; |
| 110 net::BackoffEntry family_fetch_backoff_; |
| 104 | 111 |
| 105 base::WeakPtrFactory<ChildAccountService> weak_ptr_factory_; | 112 base::WeakPtrFactory<ChildAccountService> weak_ptr_factory_; |
| 106 | 113 |
| 107 DISALLOW_COPY_AND_ASSIGN(ChildAccountService); | 114 DISALLOW_COPY_AND_ASSIGN(ChildAccountService); |
| 108 }; | 115 }; |
| 109 | 116 |
| 110 #endif // CHROME_BROWSER_SUPERVISED_USER_CHILD_ACCOUNTS_CHILD_ACCOUNT_SERVICE_H
_ | 117 #endif // CHROME_BROWSER_SUPERVISED_USER_CHILD_ACCOUNTS_CHILD_ACCOUNT_SERVICE_H
_ |
| OLD | NEW |