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

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

Issue 253063002: CleanUp: Introduce UserInfo. Move session_state stuff to ash/session. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix tests Created 6 years, 8 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
Index: chrome/browser/chromeos/login/user.cc
diff --git a/chrome/browser/chromeos/login/user.cc b/chrome/browser/chromeos/login/user.cc
index f165e552d665c7c44311f1a12ebea77038f644dd..c21222894579b6336e124baf8dcc61414cd83627 100644
--- a/chrome/browser/chromeos/login/user.cc
+++ b/chrome/browser/chromeos/login/user.cc
@@ -10,6 +10,7 @@
#include "base/threading/thread_restrictions.h"
#include "chrome/browser/chromeos/login/default_user_images.h"
#include "chrome/browser/chromeos/login/user_manager.h"
+#include "google_apis/gaia/gaia_auth_util.h"
#include "grit/theme_resources.h"
#include "ui/base/resource/resource_bundle.h"
@@ -168,6 +169,10 @@ void UserContext::CopyFrom(const UserContext& other) {
auth_flow = other.auth_flow;
}
+std::string User::GetEmail() const {
+ return display_email();
+}
+
base::string16 User::GetDisplayName() const {
// Fallback to the email account name in case display name haven't been set.
return display_name_.empty() ?
@@ -175,6 +180,18 @@ base::string16 User::GetDisplayName() const {
display_name_;
}
+base::string16 User::GetGivenName() const {
+ return given_name_;
+}
+
+const gfx::ImageSkia& User::GetImage() const {
+ return user_image_.image();
+}
+
+std::string User::GetUserID() const {
+ return gaia::CanonicalizeEmail(gaia::SanitizeEmail(email()));
+}
+
std::string User::GetAccountName(bool use_display_email) const {
if (use_display_email && !display_email_.empty())
return GetUserName(display_email_);
« no previous file with comments | « chrome/browser/chromeos/login/user.h ('k') | chrome/browser/chromeos/login/user_adding_screen_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698