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 COMPONENTS_SIGNIN_CORE_BROWSER_ACCOUNT_TRACKER_SERVICE_H_ | 5 #ifndef COMPONENTS_SIGNIN_CORE_BROWSER_ACCOUNT_TRACKER_SERVICE_H_ |
6 #define COMPONENTS_SIGNIN_CORE_BROWSER_ACCOUNT_TRACKER_SERVICE_H_ | 6 #define COMPONENTS_SIGNIN_CORE_BROWSER_ACCOUNT_TRACKER_SERVICE_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 | 108 |
109 // Picks the correct account_id for the specified account depending on the | 109 // Picks the correct account_id for the specified account depending on the |
110 // migration state. | 110 // migration state. |
111 std::string PickAccountIdForAccount(const std::string& gaia, | 111 std::string PickAccountIdForAccount(const std::string& gaia, |
112 const std::string& email); | 112 const std::string& email); |
113 static std::string PickAccountIdForAccount(PrefService* pref_service, | 113 static std::string PickAccountIdForAccount(PrefService* pref_service, |
114 const std::string& gaia, | 114 const std::string& gaia, |
115 const std::string& email); | 115 const std::string& email); |
116 | 116 |
117 // Seeds the account whose account_id is given by PickAccountIdForAccount() | 117 // Seeds the account whose account_id is given by PickAccountIdForAccount() |
118 // with its corresponding gaia id and email address. | 118 // with its corresponding gaia id and email address. Returns the same |
119 void SeedAccountInfo(const std::string& gaia, const std::string& email); | 119 // value PickAccountIdForAccount() when given the same arguments. |
| 120 std::string SeedAccountInfo(const std::string& gaia, |
| 121 const std::string& email); |
120 | 122 |
121 AccountIdMigrationState GetMigrationState(); | 123 AccountIdMigrationState GetMigrationState(); |
122 static AccountIdMigrationState GetMigrationState(PrefService* pref_service); | 124 static AccountIdMigrationState GetMigrationState(PrefService* pref_service); |
123 | 125 |
124 protected: | 126 protected: |
125 // Available to be called in tests. | 127 // Available to be called in tests. |
126 void SetAccountStateFromUserInfo(const std::string& account_id, | 128 void SetAccountStateFromUserInfo(const std::string& account_id, |
127 const base::DictionaryValue* user_info); | 129 const base::DictionaryValue* user_info); |
128 | 130 |
129 private: | 131 private: |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 std::list<std::string> pending_user_info_fetches_; | 176 std::list<std::string> pending_user_info_fetches_; |
175 | 177 |
176 // Holds references to refresh token annotation requests keyed by account_id. | 178 // Holds references to refresh token annotation requests keyed by account_id. |
177 base::ScopedPtrHashMap<std::string, RefreshTokenAnnotationRequest> | 179 base::ScopedPtrHashMap<std::string, RefreshTokenAnnotationRequest> |
178 refresh_token_annotation_requests_; | 180 refresh_token_annotation_requests_; |
179 | 181 |
180 DISALLOW_COPY_AND_ASSIGN(AccountTrackerService); | 182 DISALLOW_COPY_AND_ASSIGN(AccountTrackerService); |
181 }; | 183 }; |
182 | 184 |
183 #endif // COMPONENTS_SIGNIN_CORE_BROWSER_ACCOUNT_TRACKER_SERVICE_H_ | 185 #endif // COMPONENTS_SIGNIN_CORE_BROWSER_ACCOUNT_TRACKER_SERVICE_H_ |
OLD | NEW |