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

Unified Diff: components/user_manager/user.h

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

Powered by Google App Engine
This is Rietveld 408576698