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

Unified Diff: components/signin/core/account_id/account_id.h

Issue 2593133002: Revert of Add account_type into AccountId (Closed)
Patch Set: Created 4 years 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
« no previous file with comments | « chromeos/tpm/tpm_token_info_getter_unittest.cc ('k') | components/signin/core/account_id/account_id.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/signin/core/account_id/account_id.h
diff --git a/components/signin/core/account_id/account_id.h b/components/signin/core/account_id/account_id.h
index 4bc02054a86caede0d828110db4523693b789483..7cba697805da512d5819523cd8998bffad5b3de3 100644
--- a/components/signin/core/account_id/account_id.h
+++ b/components/signin/core/account_id/account_id.h
@@ -10,28 +10,18 @@
#include <string>
#include "base/containers/hash_tables.h"
-enum class AccountType { UNKNOWN, GOOGLE, ACTIVE_DIRECTORY };
-
// Type that contains enough information to identify user.
//
// TODO(alemate): we are in the process of moving away from std::string as a
// type for storing user identifier to AccountId. At this time GaiaId is mostly
// empty, so this type is used as a replacement for e-mail string.
// But in near future AccountId will become full feature user identifier.
-// TODO(alemate): Rename functions and fields to reflect different types of
-// accounts. (see crbug.com/672253)
class AccountId {
public:
struct EmptyAccountId;
AccountId(const AccountId& other);
- // If any of the comparable AccountIds has AccountType == UNKNOWN then it
- // compares emails.
- // If both are not UNKNOWN and not equal then it returns false.
- // If AccountType == GOOGLE then it checks if either ids or emails are equal.
- // If AccountType == ACTIVE_DIRECTORY then it checks if ids and emails are
- // equal.
bool operator==(const AccountId& other) const;
bool operator!=(const AccountId& other) const;
bool operator<(const AccountId& right) const;
@@ -41,45 +31,28 @@
bool is_valid() const;
void clear();
- AccountType GetAccountType() const;
+ const std::string& GetAccountType() const;
const std::string& GetGaiaId() const;
- const std::string& GetObjGuid() const;
// Users of AccountId should make no assumptions on the format of email.
// I.e. it cannot be used as account identifier, because it is (in general)
// non-comparable.
const std::string& GetUserEmail() const;
- // Returns true if |GetAccountIdKey| would return valid key.
- bool HasAccountIdKey() const;
// This returns prefixed some string that can be used as a storage key.
// You should make no assumptions on the format of this string.
const std::string GetAccountIdKey() const;
+ void SetGaiaId(const std::string& gaia_id);
void SetUserEmail(const std::string& email);
// This method is to be used during transition period only.
- // AccountId with UNKNOWN AccountType;
static AccountId FromUserEmail(const std::string& user_email);
- // AccountId with GOOGLE AccountType;
// This method is to be used during transition period only.
static AccountId FromGaiaId(const std::string& gaia_id);
// This method is the preferred way to construct AccountId if you have
// full account information.
- // AccountId with GOOGLE AccountType;
static AccountId FromUserEmailGaiaId(const std::string& user_email,
const std::string& gaia_id);
- // These methods are used to construct Active Directory AccountIds.
- // AccountId with ACTIVE_DIRECTORY AccountType;
- static AccountId AdFromUserEmailObjGuid(const std::string& email,
- const std::string& obj_guid);
- // AccountId with ACTIVE_DIRECTORY AccountType;
- static AccountId AdFromObjGuid(const std::string& obj_guid);
-
- // Translation functions between AccountType and std::string. Used for
- // serialization.
- static AccountType StringToAccountType(
- const std::string& account_type_string);
- static std::string AccountTypeToString(const AccountType& account_type);
// These are (for now) unstable and cannot be used to store serialized data to
// persistent storage. Only in-memory storage is safe.
@@ -91,13 +64,10 @@
private:
AccountId();
- AccountId(const std::string& id,
- const std::string& user_email,
- const AccountType& account_type);
+ AccountId(const std::string& gaia_id, const std::string& user_email);
- std::string id_;
+ std::string gaia_id_;
std::string user_email_;
- AccountType account_type_ = AccountType::UNKNOWN;
};
// Returns a reference to a singleton.
« no previous file with comments | « chromeos/tpm/tpm_token_info_getter_unittest.cc ('k') | components/signin/core/account_id/account_id.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698