| 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 user_image_.set_url(image_url); | 60 user_image_.set_url(image_url); |
| 61 } | 61 } |
| 62 | 62 |
| 63 void User::SetStubImage(int image_index) { | 63 void User::SetStubImage(int image_index) { |
| 64 user_image_.SetImage(*ResourceBundle::GetSharedInstance().GetImageSkiaNamed( | 64 user_image_.SetImage(*ResourceBundle::GetSharedInstance().GetImageSkiaNamed( |
| 65 kStubImageResourceID)); | 65 kStubImageResourceID)); |
| 66 image_index_ = image_index; | 66 image_index_ = image_index; |
| 67 image_is_stub_ = true; | 67 image_is_stub_ = true; |
| 68 } | 68 } |
| 69 | 69 |
| 70 void User::SetWallpaperThumbnail(const SkBitmap& wallpaper_thumbnail) { | |
| 71 wallpaper_thumbnail_ = wallpaper_thumbnail; | |
| 72 } | |
| 73 | |
| 74 std::string User::GetAccountName(bool use_display_email) const { | 70 std::string User::GetAccountName(bool use_display_email) const { |
| 75 if (use_display_email && !display_email_.empty()) | 71 if (use_display_email && !display_email_.empty()) |
| 76 return GetUserName(display_email_); | 72 return GetUserName(display_email_); |
| 77 else | 73 else |
| 78 return GetUserName(email_); | 74 return GetUserName(email_); |
| 79 } | 75 } |
| 80 | 76 |
| 81 string16 User::GetDisplayName() const { | 77 string16 User::GetDisplayName() const { |
| 82 // Fallback to the email account name in case display name haven't been set. | 78 // Fallback to the email account name in case display name haven't been set. |
| 83 return display_name_.empty() ? | 79 return display_name_.empty() ? |
| 84 UTF8ToUTF16(GetAccountName(true)) : | 80 UTF8ToUTF16(GetAccountName(true)) : |
| 85 display_name_; | 81 display_name_; |
| 86 } | 82 } |
| 87 | 83 |
| 88 } // namespace chromeos | 84 } // namespace chromeos |
| OLD | NEW |