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

Side by Side Diff: chrome/browser/chromeos/login/user.cc

Issue 10541036: Show account part of the display email when real name is not available. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: comments Created 8 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/chromeos/login/user.h" 5 #include "chrome/browser/chromeos/login/user.h"
6 6
7 #include "base/stringprintf.h" 7 #include "base/stringprintf.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "chrome/browser/chromeos/login/default_user_images.h" 9 #include "chrome/browser/chromeos/login/default_user_images.h"
10 #include "chrome/browser/chromeos/login/user_manager.h" 10 #include "chrome/browser/chromeos/login/user_manager.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 image_ = *ResourceBundle::GetSharedInstance().GetImageSkiaNamed( 59 image_ = *ResourceBundle::GetSharedInstance().GetImageSkiaNamed(
60 kStubImageResourceID); 60 kStubImageResourceID);
61 image_index_ = image_index; 61 image_index_ = image_index;
62 image_is_stub_ = true; 62 image_is_stub_ = true;
63 } 63 }
64 64
65 void User::SetWallpaperThumbnail(const SkBitmap& wallpaper_thumbnail) { 65 void User::SetWallpaperThumbnail(const SkBitmap& wallpaper_thumbnail) {
66 wallpaper_thumbnail_ = wallpaper_thumbnail; 66 wallpaper_thumbnail_ = wallpaper_thumbnail;
67 } 67 }
68 68
69 std::string User::GetAccountName() const { 69 std::string User::GetAccountName(bool use_display_email) const {
70 return GetUserName(email_); 70 if (use_display_email && !display_email_.empty())
71 return GetUserName(display_email_);
72 else
73 return GetUserName(email_);
71 } 74 }
72 75
73 string16 User::GetDisplayName() const { 76 string16 User::GetDisplayName() const {
74 return display_name_; 77 return display_name_;
75 } 78 }
76 79
77 } // namespace chromeos 80 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/user.h ('k') | chrome/browser/chromeos/login/user_manager_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698