Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(148)

Side by Side Diff: components/signin/core/browser/account_tracker_service.h

Issue 1380103004: Delay fetching account info until OnRefreshTokensLoaded(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 // (see http://crbug.com/171406) 86 // (see http://crbug.com/171406)
87 void Initialize(SigninClient* signin_client); 87 void Initialize(SigninClient* signin_client);
88 88
89 // Returns the list of known accounts and for which gaia IDs 89 // Returns the list of known accounts and for which gaia IDs
90 // have been fetched. 90 // have been fetched.
91 std::vector<AccountInfo> GetAccounts() const; 91 std::vector<AccountInfo> GetAccounts() const;
92 AccountInfo GetAccountInfo(const std::string& account_id) const; 92 AccountInfo GetAccountInfo(const std::string& account_id) const;
93 AccountInfo FindAccountInfoByGaiaId(const std::string& gaia_id) const; 93 AccountInfo FindAccountInfoByGaiaId(const std::string& gaia_id) const;
94 AccountInfo FindAccountInfoByEmail(const std::string& email) const; 94 AccountInfo FindAccountInfoByEmail(const std::string& email) const;
95 95
96 bool IsTrackingAccount(const std::string& account_id) const;
97 bool HasIdNameMappingForAccount(const std::string& account_id) const;
98 bool HasIdNameMappingForAllAccounts() const;
99
96 // Picks the correct account_id for the specified account depending on the 100 // Picks the correct account_id for the specified account depending on the
97 // migration state. 101 // migration state.
98 std::string PickAccountIdForAccount(const std::string& gaia, 102 std::string PickAccountIdForAccount(const std::string& gaia,
99 const std::string& email) const; 103 const std::string& email) const;
100 static std::string PickAccountIdForAccount(const PrefService* pref_service, 104 static std::string PickAccountIdForAccount(const PrefService* pref_service,
101 const std::string& gaia, 105 const std::string& gaia,
102 const std::string& email); 106 const std::string& email);
103 107
104 // Seeds the account whose account_id is given by PickAccountIdForAccount() 108 // Seeds the account whose account_id is given by PickAccountIdForAccount()
105 // with its corresponding gaia id and email address. Returns the same 109 // with its corresponding gaia id and email address. Returns the same
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 void SetMigrationState(AccountIdMigrationState state); 151 void SetMigrationState(AccountIdMigrationState state);
148 152
149 SigninClient* signin_client_; // Not owned. 153 SigninClient* signin_client_; // Not owned.
150 std::map<std::string, AccountState> accounts_; 154 std::map<std::string, AccountState> accounts_;
151 base::ObserverList<Observer> observer_list_; 155 base::ObserverList<Observer> observer_list_;
152 156
153 DISALLOW_COPY_AND_ASSIGN(AccountTrackerService); 157 DISALLOW_COPY_AND_ASSIGN(AccountTrackerService);
154 }; 158 };
155 159
156 #endif // COMPONENTS_SIGNIN_CORE_BROWSER_ACCOUNT_TRACKER_SERVICE_H_ 160 #endif // COMPONENTS_SIGNIN_CORE_BROWSER_ACCOUNT_TRACKER_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698