OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 CHROME_BROWSER_EXTENSIONS_API_IDENTITY_ACCOUNT_TRACKER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_IDENTITY_ACCOUNT_TRACKER_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_API_IDENTITY_ACCOUNT_TRACKER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_IDENTITY_ACCOUNT_TRACKER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 void ReportAuthError(const std::string& account_key, | 57 void ReportAuthError(const std::string& account_key, |
58 const GoogleServiceAuthError& error); | 58 const GoogleServiceAuthError& error); |
59 | 59 |
60 void AddObserver(Observer* observer); | 60 void AddObserver(Observer* observer); |
61 void RemoveObserver(Observer* observer); | 61 void RemoveObserver(Observer* observer); |
62 | 62 |
63 // Returns the list of accounts that are signed in, and for which gaia IDs | 63 // Returns the list of accounts that are signed in, and for which gaia IDs |
64 // have been fetched. The primary account for the profile will be first | 64 // have been fetched. The primary account for the profile will be first |
65 // in the vector. Additional accounts will be in order of their gaia IDs. | 65 // in the vector. Additional accounts will be in order of their gaia IDs. |
66 std::vector<AccountIds> GetAccounts() const; | 66 std::vector<AccountIds> GetAccounts() const; |
| 67 std::string FindAccountKeyByGaiaId(const std::string& gaia_id); |
67 | 68 |
68 // OAuth2TokenService::Observer implementation. | 69 // OAuth2TokenService::Observer implementation. |
69 virtual void OnRefreshTokenAvailable(const std::string& account_key) OVERRIDE; | 70 virtual void OnRefreshTokenAvailable(const std::string& account_key) OVERRIDE; |
70 virtual void OnRefreshTokenRevoked(const std::string& account_key) OVERRIDE; | 71 virtual void OnRefreshTokenRevoked(const std::string& account_key) OVERRIDE; |
71 | 72 |
72 void OnUserInfoFetchSuccess(AccountIdFetcher* fetcher, | 73 void OnUserInfoFetchSuccess(AccountIdFetcher* fetcher, |
73 const std::string& gaia_id); | 74 const std::string& gaia_id); |
74 void OnUserInfoFetchFailure(AccountIdFetcher* fetcher); | 75 void OnUserInfoFetchFailure(AccountIdFetcher* fetcher); |
75 | 76 |
76 // AuthStatusProvider implementation. | 77 // AuthStatusProvider implementation. |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 AccountTracker* tracker_; | 144 AccountTracker* tracker_; |
144 const std::string account_key_; | 145 const std::string account_key_; |
145 | 146 |
146 scoped_ptr<OAuth2TokenService::Request> login_token_request_; | 147 scoped_ptr<OAuth2TokenService::Request> login_token_request_; |
147 scoped_ptr<gaia::GaiaOAuthClient> gaia_oauth_client_; | 148 scoped_ptr<gaia::GaiaOAuthClient> gaia_oauth_client_; |
148 }; | 149 }; |
149 | 150 |
150 } // namespace extensions | 151 } // namespace extensions |
151 | 152 |
152 #endif // CHROME_BROWSER_EXTENSIONS_API_IDENTITY_ACCOUNT_TRACKER_H_ | 153 #endif // CHROME_BROWSER_EXTENSIONS_API_IDENTITY_ACCOUNT_TRACKER_H_ |
OLD | NEW |