OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 COMPONENTS_SIGNIN_CORE_BROWSER_ACCOUNT_FETCHER_SERVICE_H_ | 5 #ifndef COMPONENTS_SIGNIN_CORE_BROWSER_ACCOUNT_FETCHER_SERVICE_H_ |
6 #define COMPONENTS_SIGNIN_CORE_BROWSER_ACCOUNT_FETCHER_SERVICE_H_ | 6 #define COMPONENTS_SIGNIN_CORE_BROWSER_ACCOUNT_FETCHER_SERVICE_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <map> | 9 #include <map> |
10 | 10 |
11 #include "base/containers/scoped_ptr_hash_map.h" | 11 #include "base/containers/scoped_ptr_hash_map.h" |
12 #include "base/memory/scoped_ptr.h" | |
12 #include "base/threading/non_thread_safe.h" | 13 #include "base/threading/non_thread_safe.h" |
13 #include "base/timer/timer.h" | 14 #include "base/timer/timer.h" |
14 #include "components/keyed_service/core/keyed_service.h" | 15 #include "components/keyed_service/core/keyed_service.h" |
15 #include "google_apis/gaia/oauth2_token_service.h" | 16 #include "google_apis/gaia/oauth2_token_service.h" |
16 | 17 |
17 class AccountInfoFetcher; | 18 class AccountInfoFetcher; |
19 class AccountSeedingTracker; | |
18 class AccountTrackerService; | 20 class AccountTrackerService; |
19 class ChildAccountInfoFetcher; | 21 class ChildAccountInfoFetcher; |
20 class OAuth2TokenService; | 22 class OAuth2TokenService; |
21 class RefreshTokenAnnotationRequest; | 23 class RefreshTokenAnnotationRequest; |
22 class SigninClient; | 24 class SigninClient; |
23 | 25 |
24 namespace invalidation { | 26 namespace invalidation { |
25 class InvalidationService; | 27 class InvalidationService; |
26 } | 28 } |
27 | 29 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
61 | 63 |
62 void FetchUserInfoBeforeSignin(const std::string& account_id); | 64 void FetchUserInfoBeforeSignin(const std::string& account_id); |
63 | 65 |
64 AccountTrackerService* account_tracker_service() const { | 66 AccountTrackerService* account_tracker_service() const { |
65 return account_tracker_service_; | 67 return account_tracker_service_; |
66 } | 68 } |
67 | 69 |
68 // Called by ChildAccountInfoFetcher. | 70 // Called by ChildAccountInfoFetcher. |
69 void SetIsChildAccount(const std::string& account_id, bool is_child_account); | 71 void SetIsChildAccount(const std::string& account_id, bool is_child_account); |
70 | 72 |
73 #if defined(OS_ANDROID) | |
knn
2015/10/05 14:11:45
Can be removed.
| |
74 // Android specific methods for keeping track of partially seeded accounts. | |
75 // Android uses email whereas Chrome uses GAIA ID. This mapping needs to be | |
76 // seeded before the AccountFetcherService can do anything. | |
77 void OnAccountsSeeded(); | |
78 | |
79 bool AreAllAccountsSeeded(); | |
80 #endif | |
81 | |
71 private: | 82 private: |
72 friend class AccountInfoFetcher; | 83 friend class AccountInfoFetcher; |
73 friend class ChildAccountInfoFetcherImpl; | 84 friend class ChildAccountInfoFetcherImpl; |
74 | 85 |
75 void RefreshAllAccountInfo(bool only_fetch_if_invalid); | 86 void RefreshAllAccountInfo(bool only_fetch_if_invalid); |
76 void RefreshAllAccountsAndScheduleNext(); | 87 void RefreshAllAccountsAndScheduleNext(); |
77 void ScheduleNextRefresh(); | 88 void ScheduleNextRefresh(); |
78 | 89 |
79 // Called on all account state changes. Decides whether to fetch new child | 90 // Called on all account state changes. Decides whether to fetch new child |
80 // status information or reset old values that aren't valid now. | 91 // status information or reset old values that aren't valid now. |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
121 std::string child_request_account_id_; | 132 std::string child_request_account_id_; |
122 scoped_ptr<ChildAccountInfoFetcher> child_info_request_; | 133 scoped_ptr<ChildAccountInfoFetcher> child_info_request_; |
123 | 134 |
124 // Holds references to account info fetchers keyed by account_id. | 135 // Holds references to account info fetchers keyed by account_id. |
125 base::ScopedPtrHashMap<std::string, scoped_ptr<AccountInfoFetcher>> | 136 base::ScopedPtrHashMap<std::string, scoped_ptr<AccountInfoFetcher>> |
126 user_info_requests_; | 137 user_info_requests_; |
127 // Holds references to refresh token annotation requests keyed by account_id. | 138 // Holds references to refresh token annotation requests keyed by account_id. |
128 base::ScopedPtrHashMap<std::string, scoped_ptr<RefreshTokenAnnotationRequest>> | 139 base::ScopedPtrHashMap<std::string, scoped_ptr<RefreshTokenAnnotationRequest>> |
129 refresh_token_annotation_requests_; | 140 refresh_token_annotation_requests_; |
130 | 141 |
142 scoped_ptr<AccountSeedingTracker> account_seeding_tracker_; | |
143 | |
131 DISALLOW_COPY_AND_ASSIGN(AccountFetcherService); | 144 DISALLOW_COPY_AND_ASSIGN(AccountFetcherService); |
132 }; | 145 }; |
133 | 146 |
134 #endif // COMPONENTS_SIGNIN_CORE_BROWSER_ACCOUNT_FETCHER_SERVICE_H_ | 147 #endif // COMPONENTS_SIGNIN_CORE_BROWSER_ACCOUNT_FETCHER_SERVICE_H_ |
OLD | NEW |