Chromium Code Reviews| Index: chrome/browser/chromeos/login/signin/token_handle_util.h |
| diff --git a/chrome/browser/chromeos/login/signin/token_handle_util.h b/chrome/browser/chromeos/login/signin/token_handle_util.h |
| index 572d33450033f61cdff45b44dcc614084c76782b..94f8d1b6041440fb29f6fe18053ac4f5a3741b32 100644 |
| --- a/chrome/browser/chromeos/login/signin/token_handle_util.h |
| +++ b/chrome/browser/chromeos/login/signin/token_handle_util.h |
| @@ -12,9 +12,11 @@ |
| #include "base/containers/scoped_ptr_hash_map.h" |
| #include "base/memory/weak_ptr.h" |
| #include "base/time/time.h" |
| -#include "components/user_manager/user_id.h" |
| +#include "components/signin/core/account_id/account_id.h" |
| #include "google_apis/gaia/gaia_oauth_client.h" |
| +class AccountId; |
| + |
| namespace base { |
| class DictionaryValue; |
| } |
| @@ -34,37 +36,36 @@ class TokenHandleUtil { |
| enum TokenHandleStatus { VALID, INVALID, UNKNOWN }; |
| - typedef base::Callback<void(const user_manager::UserID&, TokenHandleStatus)> |
| + typedef base::Callback<void(const AccountId&, TokenHandleStatus)> |
|
achuithb
2015/10/28 23:11:45
using
Alexander Alekseev
2015/10/29 02:00:40
Done.
|
| TokenValidationCallback; |
| - // Returns true if UserManager has token handle associated with |user_id|. |
| - bool HasToken(const user_manager::UserID& user_id); |
| + // Returns true if UserManager has token handle associated with |account_id|. |
| + bool HasToken(const AccountId& account_id); |
| - // Removes token handle for |user_id| from UserManager storage. |
| - void DeleteHandle(const user_manager::UserID& user_id); |
| + // Removes token handle for |account_id| from UserManager storage. |
| + void DeleteHandle(const AccountId& account_id); |
| // Marks current handle as invalid, new one should be obtained at next sign |
| // in. |
| - void MarkHandleInvalid(const user_manager::UserID& user_id); |
| + void MarkHandleInvalid(const AccountId& account_id); |
| - // Indicates if token handle for |user_id| is missing or marked as invalid. |
| - bool ShouldObtainHandle(const user_manager::UserID& user_id); |
| + // Indicates if token handle for |account_id| is missing or marked as invalid. |
| + bool ShouldObtainHandle(const AccountId& account_id); |
| - // Performs token handle check for |user_id|. Will call |callback| with |
| + // Performs token handle check for |account_id|. Will call |callback| with |
| // corresponding result. |
| - void CheckToken(const user_manager::UserID& user_id, |
| + void CheckToken(const AccountId& account_id, |
| const TokenValidationCallback& callback); |
| - // Given the token |handle| store it for |user_id|. |
| - void StoreTokenHandle(const user_manager::UserID& user_id, |
| - const std::string& handle); |
| + // Given the token |handle| store it for |account_id|. |
| + void StoreTokenHandle(const AccountId& account_id, const std::string& handle); |
| private: |
| // Associates GaiaOAuthClient::Delegate with User ID and Token. |
| class TokenDelegate : public gaia::GaiaOAuthClient::Delegate { |
| public: |
| TokenDelegate(const base::WeakPtr<TokenHandleUtil>& owner, |
| - const user_manager::UserID& user_id, |
| + const AccountId& account_id, |
| const std::string& token, |
| const TokenValidationCallback& callback); |
| ~TokenDelegate() override; |
| @@ -76,7 +77,7 @@ class TokenHandleUtil { |
| private: |
| base::WeakPtr<TokenHandleUtil> owner_; |
| - user_manager::UserID user_id_; |
| + AccountId account_id_; |
| std::string token_; |
| base::TimeTicks tokeninfo_response_start_time_; |
| TokenValidationCallback callback_; |
| @@ -85,7 +86,7 @@ class TokenHandleUtil { |
| }; |
| void OnValidationComplete(const std::string& token); |
| - void OnObtainTokenComplete(const user_manager::UserID& id); |
| + void OnObtainTokenComplete(const AccountId& account_id); |
| // UserManager that stores corresponding user data. |
| user_manager::UserManager* user_manager_; |
| @@ -95,7 +96,7 @@ class TokenHandleUtil { |
| validation_delegates_; |
| // Map of pending obtain operations. |
| - base::ScopedPtrHashMap<user_manager::UserID, scoped_ptr<TokenDelegate>> |
| + base::ScopedPtrHashMap<AccountId, scoped_ptr<TokenDelegate>> |
| obtain_delegates_; |
| // Instance of GAIA Client. |