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

Unified Diff: chrome/browser/chromeos/login/signin/token_handle_util.h

Issue 1412813003: This CL replaces user_manager::UserID with AccountId. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@468875--Chrome-OS-handles-deletion-of-Gmail-account-poorly--Create-AccountID-structure-part2--user_names
Patch Set: Rebased. 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 side-by-side diff with in-line comments
Download patch
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..f29b7ed6612d2c9f19456b5f0749c26d5fa96989 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)>
TokenValidationCallback;
// Returns true if UserManager has token handle associated with |user_id|.
- bool HasToken(const user_manager::UserID& user_id);
+ bool HasToken(const AccountId& user_id);
achuithb 2015/10/23 00:08:50 account_id here and everywhere below
Alexander Alekseev 2015/10/23 09:11:22 Done.
// Removes token handle for |user_id| from UserManager storage.
- void DeleteHandle(const user_manager::UserID& user_id);
+ void DeleteHandle(const AccountId& user_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& user_id);
// Indicates if token handle for |user_id| is missing or marked as invalid.
- bool ShouldObtainHandle(const user_manager::UserID& user_id);
+ bool ShouldObtainHandle(const AccountId& user_id);
// Performs token handle check for |user_id|. Will call |callback| with
// corresponding result.
- void CheckToken(const user_manager::UserID& user_id,
+ void CheckToken(const AccountId& user_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);
+ void StoreTokenHandle(const AccountId& user_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& user_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 user_id_;
achuithb 2015/10/23 00:08:50 account_id_
Alexander Alekseev 2015/10/23 09:11:22 Done.
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& id);
achuithb 2015/10/23 00:08:50 account_id
Alexander Alekseev 2015/10/23 09:11:22 Done.
// 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.

Powered by Google App Engine
This is Rietveld 408576698