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

Unified Diff: chrome/browser/ui/webui/settings/profile_info_handler.cc

Issue 2730993003: MD Settings: People: Show correct user name (Closed)
Patch Set: . Created 3 years, 9 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 | « no previous file | chrome/browser/ui/webui/settings/profile_info_handler_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/settings/profile_info_handler.cc
diff --git a/chrome/browser/ui/webui/settings/profile_info_handler.cc b/chrome/browser/ui/webui/settings/profile_info_handler.cc
index d6510f5da1955622f2389272da5bc644d2dd9b3f..29812189982a6e862e3b63ef220c04bf7d9870c8 100644
--- a/chrome/browser/ui/webui/settings/profile_info_handler.cc
+++ b/chrome/browser/ui/webui/settings/profile_info_handler.cc
@@ -188,19 +188,14 @@ ProfileInfoHandler::GetAccountNameAndIcon() const {
std::string icon_url;
#if defined(OS_CHROMEOS)
- name = profile_->GetProfileUserName();
- std::string user_email;
- if (name.empty()) {
- // User is not associated with a gaia account, use the display name.
- const user_manager::User* user =
- chromeos::ProfileHelper::Get()->GetUserByProfile(profile_);
- // Note: We don't show the User section in Guest mode.
- DCHECK(user && (user->GetType() != user_manager::USER_TYPE_GUEST));
- name = base::UTF16ToUTF8(user->GetDisplayName());
+ const user_manager::User* user =
+ chromeos::ProfileHelper::Get()->GetUserByProfile(profile_);
+ DCHECK(user);
+ name = base::UTF16ToUTF8(user->GetDisplayName());
+ std::string user_email = profile_->GetProfileUserName();
+ if (user_email.empty()) {
+ // User is not associated with a gaia account.
user_email = user->GetAccountId().GetUserEmail();
- } else {
- name = gaia::SanitizeEmail(gaia::CanonicalizeEmail(name));
- user_email = name;
}
// Get image as data URL instead of using chrome://userimage source to avoid
« no previous file with comments | « no previous file | chrome/browser/ui/webui/settings/profile_info_handler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698