Chromium Code Reviews| 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 7cba697805da512d5819523cd8998bffad5b3de3..17a5a443296e7610106ae663a76757ff10481c19 100644 |
| --- a/components/signin/core/account_id/account_id.h |
| +++ b/components/signin/core/account_id/account_id.h |
| @@ -18,6 +18,10 @@ |
| // But in near future AccountId will become full feature user identifier. |
| class AccountId { |
| public: |
| + // Known account types. |
| + static const std::string kGoogle; |
|
Andrew T Wilson (Slow)
2016/11/29 11:05:36
Why are we defining account types as strings and n
Roman Sorokin (ftl)
2016/12/02 11:13:11
Switched to enum class AccountType
|
| + static const std::string kAd; |
| + |
| struct EmptyAccountId; |
| AccountId(const AccountId& other); |
| @@ -44,6 +48,7 @@ class AccountId { |
| void SetGaiaId(const std::string& gaia_id); |
| void SetUserEmail(const std::string& email); |
| + void SetAccountType(const std::string& account_type); |
| // This method is to be used during transition period only. |
| static AccountId FromUserEmail(const std::string& user_email); |
| @@ -53,6 +58,13 @@ class AccountId { |
| // full account information. |
| static AccountId FromUserEmailGaiaId(const std::string& user_email, |
| const std::string& gaia_id); |
| + // This method is used to construct AccountId with specific types. |
| + static AccountId FromUserEmailGaiaIdAccountType( |
| + const std::string& email, |
| + const std::string& gaia_id, |
| + const std::string& account_type); |
| + static AccountId FromGaiaIdAccountType(const std::string& gaia_id, |
| + const std::string& account_type); |
| // These are (for now) unstable and cannot be used to store serialized data to |
| // persistent storage. Only in-memory storage is safe. |
| @@ -65,9 +77,13 @@ class AccountId { |
| private: |
| AccountId(); |
| AccountId(const std::string& gaia_id, const std::string& user_email); |
| + AccountId(const std::string& gaia_id, |
| + const std::string& user_email, |
| + const std::string& account_type); |
| std::string gaia_id_; |
| std::string user_email_; |
| + std::string account_type_ = kGoogle; |
| }; |
| // Returns a reference to a singleton. |