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