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

Unified Diff: chrome/browser/chromeos/login/user.h

Issue 10454044: Added support for animated/nonanimated user image. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 7 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
Index: chrome/browser/chromeos/login/user.h
diff --git a/chrome/browser/chromeos/login/user.h b/chrome/browser/chromeos/login/user.h
index 24a926b6b8aa539e646f5d9da0f0502be8720cc6..bf9820ef359e64d8c175332bdb336cffbd3aefe7 100644
--- a/chrome/browser/chromeos/login/user.h
+++ b/chrome/browser/chromeos/login/user.h
@@ -17,6 +17,8 @@ const char kDemoUser[] = "demouser";
namespace chromeos {
+class UserImage;
+
// A class representing information about a previously logged in user.
// Each user has a canonical email (username), returned by |email()| and
// may have a different displayed email (in the raw form as entered by user),
@@ -64,6 +66,15 @@ class User {
// The image for this user.
const SkBitmap& image() const { return image_; }
int image_index() const { return image_index_; }
+ bool has_gif_image() const { return has_gif_image_; }
Ivan Korotkov 2012/05/29 10:50:23 This may be kind of "architecture astronautism" bu
ygorshenin1 2012/05/30 12:17:34 Done.
+
+ bool gif_image(std::vector<unsigned char>* raw_data) const {
Ivan Korotkov 2012/05/29 10:50:23 Only trivial inline setters/getters should be unix
ygorshenin1 2012/05/30 12:17:34 Done.
+ if (raw_data && has_gif_image()) {
+ *raw_data = gif_image_;
+ return true;
+ }
+ return false;
+ }
// The thumbnail of user custom wallpaper.
const SkBitmap& wallpaper_thumbnail() const { return wallpaper_thumbnail_; }
@@ -90,7 +101,8 @@ class User {
~User();
// Setters are private so only UserManager can call them.
- void SetImage(const SkBitmap& image, int image_index);
+ void SetImage(const UserImage& user_image, int image_index);
+
// Sets a stub image until the next |SetImage| call. |image_index| may be
// one of |kExternalImageIndex| or |kProfileImageIndex|.
void SetStubImage(int image_index);
@@ -110,6 +122,8 @@ class User {
// The displayed user email, defaults to |email_|.
std::string display_email_;
SkBitmap image_;
Ivan Korotkov 2012/05/29 10:50:23 It looks like there is some duplication between th
ygorshenin1 2012/05/30 12:17:34 Done.
+ bool has_gif_image_;
+ std::vector<unsigned char> gif_image_;
Ivan Korotkov 2012/05/29 10:50:23 Use UserImage::RawImage instead.
ygorshenin1 2012/05/30 12:17:34 As recommended to use UserImage instead of SkBitma
OAuthTokenStatus oauth_token_status_;
SkBitmap wallpaper_thumbnail_;

Powered by Google App Engine
This is Rietveld 408576698