Index: components/user_manager/user.h |
diff --git a/components/user_manager/user.h b/components/user_manager/user.h |
index d961acf316a53428c1a40815dacb8dde0ab569cd..fe0899ef1079836d3d83e3e2e8bd1b92e306c38d 100644 |
--- a/components/user_manager/user.h |
+++ b/components/user_manager/user.h |
@@ -10,7 +10,7 @@ |
#include "base/basictypes.h" |
#include "base/strings/string16.h" |
-#include "components/user_manager/user_id.h" |
+#include "components/signin/core/account_id/account_id.h" |
#include "components/user_manager/user_image/user_image.h" |
#include "components/user_manager/user_info.h" |
#include "components/user_manager/user_manager_export.h" |
@@ -83,7 +83,8 @@ class USER_MANAGER_EXPORT User : public UserInfo { |
virtual UserType GetType() const = 0; |
// The email the user used to log in. |
- const std::string& email() const { return email_; } |
+ // TODO(alemate): rename this to GetUserEmail() (see crbug.com/548923) |
+ const std::string& email() const; |
// The displayed user name. |
base::string16 display_name() const { return display_name_; } |
@@ -96,7 +97,7 @@ class USER_MANAGER_EXPORT User : public UserInfo { |
base::string16 GetDisplayName() const override; |
base::string16 GetGivenName() const override; |
const gfx::ImageSkia& GetImage() const override; |
- UserID GetUserID() const override; |
+ AccountId GetAccountId() const override; |
// Allows managing child status of the user. Used for RegularUser. |
virtual void SetIsChild(bool is_child); |
@@ -182,13 +183,13 @@ class USER_MANAGER_EXPORT User : public UserInfo { |
friend class chromeos::UserAddingScreenTest; |
// Do not allow anyone else to create new User instances. |
- static User* CreateRegularUser(const UserID& email); |
+ static User* CreateRegularUser(const AccountId& account_id); |
static User* CreateGuestUser(); |
- static User* CreateKioskAppUser(const UserID& kiosk_app_username); |
- static User* CreateSupervisedUser(const UserID& username); |
- static User* CreatePublicAccountUser(const UserID& email); |
+ static User* CreateKioskAppUser(const AccountId& kiosk_app_account_id); |
+ static User* CreateSupervisedUser(const AccountId& account_id); |
+ static User* CreatePublicAccountUser(const AccountId& account_id); |
- explicit User(const std::string& email); |
+ explicit User(const AccountId& account_id); |
~User() override; |
const std::string* GetAccountLocale() const { return account_locale_.get(); } |
@@ -251,15 +252,15 @@ class USER_MANAGER_EXPORT User : public UserInfo { |
} |
private: |
- std::string email_; |
+ AccountId account_id_; |
base::string16 display_name_; |
base::string16 given_name_; |
// The displayed user email, defaults to |email_|. |
std::string display_email_; |
- bool using_saml_; |
+ bool using_saml_ = false; |
UserImage user_image_; |
- OAuthTokenStatus oauth_token_status_; |
- bool force_online_signin_; |
+ OAuthTokenStatus oauth_token_status_ = OAUTH_TOKEN_STATUS_UNKNOWN; |
+ bool force_online_signin_ = false; |
// This is set to chromeos locale if account data has been downloaded. |
// (Or failed to download, but at least one download attempt finished). |
@@ -272,34 +273,34 @@ class USER_MANAGER_EXPORT User : public UserInfo { |
// Either index of a default image for the user, |USER_IMAGE_EXTERNAL| or |
// |USER_IMAGE_PROFILE|. |
- int image_index_; |
+ int image_index_ = USER_IMAGE_INVALID; |
// True if current user image is a stub set by a |SetStubImage| call. |
- bool image_is_stub_; |
+ bool image_is_stub_ = false; |
// True if current user image is being loaded from file. |
- bool image_is_loading_; |
+ bool image_is_loading_ = false; |
// True if user is able to lock screen. |
- bool can_lock_; |
+ bool can_lock_ = false; |
// True if user is currently logged in in current session. |
- bool is_logged_in_; |
+ bool is_logged_in_ = false; |
// True if user is currently logged in and active in current session. |
- bool is_active_; |
+ bool is_active_ = false; |
// True if user Profile is created |
- bool profile_is_created_; |
+ bool profile_is_created_ = false; |
// True if the user is affiliated to the device. |
- bool is_affiliated_; |
+ bool is_affiliated_ = false; |
DISALLOW_COPY_AND_ASSIGN(User); |
}; |
// List of known users. |
-typedef std::vector<User*> UserList; |
+using UserList = std::vector<User*>; |
} // namespace user_manager |