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 <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
72 // have been fetched. | 72 // have been fetched. |
73 std::vector<AccountInfo> GetAccounts() const; | 73 std::vector<AccountInfo> GetAccounts() const; |
74 AccountInfo GetAccountInfo(const std::string& account_id); | 74 AccountInfo GetAccountInfo(const std::string& account_id); |
75 AccountInfo FindAccountInfoByGaiaId(const std::string& gaia_id); | 75 AccountInfo FindAccountInfoByGaiaId(const std::string& gaia_id); |
76 AccountInfo FindAccountInfoByEmail(const std::string& email); | 76 AccountInfo FindAccountInfoByEmail(const std::string& email); |
77 | 77 |
78 // Indicates if all user information has been fetched. If the result is false, | 78 // Indicates if all user information has been fetched. If the result is false, |
79 // there are still unfininshed fetchers. | 79 // there are still unfininshed fetchers. |
80 virtual bool IsAllUserInfoFetched() const; | 80 virtual bool IsAllUserInfoFetched() const; |
81 | 81 |
82 // Picks the corect account_id for the specified account depending on the | |
bartfab (slow)
2014/10/14 17:12:38
Nit: s/corect/correct/
Roger Tawa OOO till Jul 10th
2014/10/16 02:39:32
Done.
| |
83 // migration state. | |
84 std::string PickAccountIdForAccount(const std::string& gaia, | |
85 const std::string& email); | |
86 static std::string PickAccountIdForAccount(PrefService* pref_service, | |
87 const std::string& gaia, | |
88 const std::string& email); | |
89 | |
90 // Seed the gaia id and email for the given account_id. | |
bartfab (slow)
2014/10/14 17:12:38
Nit: No |account_id| is being given here, so it is
guohui
2014/10/14 18:50:02
nits:s/Seed/Seeds/
maybe better to rename gaia to
Roger Tawa OOO till Jul 10th
2014/10/16 02:39:32
Fixed up the comment. Let me know if this is clea
bartfab (slow)
2014/10/17 09:54:55
The comment is clearer now, thanks. The logic is s
| |
91 void SeedAccountInfo(const std::string& gaia, const std::string& email); | |
92 | |
82 AccountIdMigrationState GetMigrationState(); | 93 AccountIdMigrationState GetMigrationState(); |
83 static AccountIdMigrationState GetMigrationState(PrefService* pref_service); | 94 static AccountIdMigrationState GetMigrationState(PrefService* pref_service); |
84 | 95 |
85 private: | 96 private: |
86 friend class AccountInfoFetcher; | 97 friend class AccountInfoFetcher; |
87 | 98 |
88 // These methods are called by fetchers. | 99 // These methods are called by fetchers. |
89 void OnUserInfoFetchSuccess(AccountInfoFetcher* fetcher, | 100 void OnUserInfoFetchSuccess(AccountInfoFetcher* fetcher, |
90 const base::DictionaryValue* user_info); | 101 const base::DictionaryValue* user_info); |
91 void OnUserInfoFetchFailure(AccountInfoFetcher* fetcher); | 102 void OnUserInfoFetchFailure(AccountInfoFetcher* fetcher); |
(...skipping 28 matching lines...) Expand all Loading... | |
120 scoped_refptr<net::URLRequestContextGetter> request_context_getter_; | 131 scoped_refptr<net::URLRequestContextGetter> request_context_getter_; |
121 std::map<std::string, AccountInfoFetcher*> user_info_requests_; | 132 std::map<std::string, AccountInfoFetcher*> user_info_requests_; |
122 std::map<std::string, AccountState> accounts_; | 133 std::map<std::string, AccountState> accounts_; |
123 ObserverList<Observer> observer_list_; | 134 ObserverList<Observer> observer_list_; |
124 bool shutdown_called_; | 135 bool shutdown_called_; |
125 | 136 |
126 DISALLOW_COPY_AND_ASSIGN(AccountTrackerService); | 137 DISALLOW_COPY_AND_ASSIGN(AccountTrackerService); |
127 }; | 138 }; |
128 | 139 |
129 #endif // COMPONENTS_SIGNIN_CORE_BROWSER_ACCOUNT_TRACKER_SERVICE_H_ | 140 #endif // COMPONENTS_SIGNIN_CORE_BROWSER_ACCOUNT_TRACKER_SERVICE_H_ |
OLD | NEW |