Index: chrome/browser/chromeos/login/user.cc |
diff --git a/chrome/browser/chromeos/login/user.cc b/chrome/browser/chromeos/login/user.cc |
index a0f4485a06c0f46bcd0e5532575b1b44d1e12a61..e6b65dd740b7f2f3f211f78daab18ee5f9bf74a4 100644 |
--- a/chrome/browser/chromeos/login/user.cc |
+++ b/chrome/browser/chromeos/login/user.cc |
@@ -30,7 +30,7 @@ std::string GetUserName(const std::string& email) { |
User::User(const std::string& email, bool is_guest) |
: email_(email), |
- image_(*ResourceBundle::GetSharedInstance().GetImageSkiaNamed( |
+ user_image_(*ResourceBundle::GetSharedInstance().GetImageSkiaNamed( |
kDefaultImageResources[0])), |
oauth_token_status_(OAUTH_TOKEN_STATUS_UNKNOWN), |
image_index_(kInvalidImageIndex), |
@@ -48,15 +48,15 @@ User::User(const std::string& email, bool is_guest) |
User::~User() {} |
-void User::SetImage(const gfx::ImageSkia& image, int image_index) { |
- image_ = image; |
+void User::SetImage(const UserImage& user_image, int image_index) { |
+ user_image_ = user_image; |
image_index_ = image_index; |
image_is_stub_ = false; |
} |
void User::SetStubImage(int image_index) { |
- image_ = *ResourceBundle::GetSharedInstance().GetImageSkiaNamed( |
- kStubImageResourceID); |
+ user_image_.SetImage(*ResourceBundle::GetSharedInstance().GetImageSkiaNamed( |
+ kStubImageResourceID)); |
image_index_ = image_index; |
image_is_stub_ = true; |
} |
@@ -77,6 +77,14 @@ bool User::NeedsNameTooltip() const { |
return !UserManager::Get()->IsDisplayNameUnique(GetDisplayName()); |
} |
+bool User::GetAnimatedImage(UserImage::RawImage* raw_image) const { |
+ if (raw_image && has_animated_image()) { |
+ *raw_image = user_image_.raw_image(); |
+ return true; |
+ } |
+ return false; |
+} |
+ |
std::string User::GetNameTooltip() const { |
const std::string& user_email = display_email_; |
size_t at_pos = user_email.rfind('@'); |