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

Unified Diff: chrome/browser/chromeos/login/user.h

Issue 8773046: [cros] Display emails of users are stored in a separate dictionary in Local State. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge Created 9 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 | « chrome/browser/chromeos/login/remove_user_delegate.h ('k') | chrome/browser/chromeos/login/user.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/login/user.h
diff --git a/chrome/browser/chromeos/login/user.h b/chrome/browser/chromeos/login/user.h
index 7921ac4d6cb71066355b5879dd2de7f0b4d5ff26..53c14678edb53337344390e8d993b856e27bf722 100644
--- a/chrome/browser/chromeos/login/user.h
+++ b/chrome/browser/chromeos/login/user.h
@@ -15,6 +15,11 @@
namespace chromeos {
// A class representing information about a previously logged in user.
+// Each user has a canonical email (username), returned by |email()| and
+// may have a different displayed email (in the raw form as entered by user),
+// returned by |displayed_email()|.
+// Displayed emails are for use in UI only, anywhere else users must be referred
+// to by |email()|.
class User {
public:
// User OAuth token status according to the last check.
@@ -45,15 +50,14 @@ class User {
bool NeedsNameTooltip() const;
// The image for this user.
- void SetImage(const SkBitmap& image, int image_index);
const SkBitmap& image() const { return image_; }
int image_index() const { return image_index_; }
// OAuth token status for this user.
OAuthTokenStatus oauth_token_status() const { return oauth_token_status_; }
- void set_oauth_token_status(OAuthTokenStatus status) {
- oauth_token_status_ = status;
- }
+
+ // The displayed (non-canonical) user email.
+ std::string display_email() const { return display_email_; }
private:
friend class UserManager;
@@ -62,7 +66,20 @@ class User {
explicit User(const std::string& email);
~User();
+ // Setters are private so only UserManager can call them.
+ void SetImage(const SkBitmap& image, int image_index);
+
+ void set_oauth_token_status(OAuthTokenStatus status) {
+ oauth_token_status_ = status;
+ }
+
+ void set_display_email(const std::string& display_email) {
+ display_email_ = display_email;
+ }
+
std::string email_;
+ // The displayed user email, defaults to |email_|.
+ std::string display_email_;
SkBitmap image_;
OAuthTokenStatus oauth_token_status_;
« no previous file with comments | « chrome/browser/chromeos/login/remove_user_delegate.h ('k') | chrome/browser/chromeos/login/user.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698