OLD | NEW |
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 Loading... |
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 |
OLD | NEW |