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

Unified Diff: components/user_manager/user_image/user_image.h

Issue 411523005: Revert of Clean up. Experimental user avatars removed. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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: components/user_manager/user_image/user_image.h
diff --git a/components/user_manager/user_image/user_image.h b/components/user_manager/user_image/user_image.h
index 03da41b633353efb64d9282d540262a647a4bcfd..81fbd76a68d021ca7034fe7390b5156023fe3d89 100644
--- a/components/user_manager/user_image/user_image.h
+++ b/components/user_manager/user_image/user_image.h
@@ -15,7 +15,8 @@
namespace user_manager {
// Wrapper class storing a still image and it's raw representation. Could be
-// used for storing profile images and user wallpapers.
+// used for storing profile images (including animated profile images) and user
+// wallpapers.
class USER_MANAGER_EXPORT UserImage {
public:
// TODO(ivankr): replace with RefCountedMemory to prevent copying.
@@ -33,6 +34,9 @@
explicit UserImage(const gfx::ImageSkia& image);
// Creates a new instance from a given still frame and raw representation.
+ // |raw_image| can be animated, in which case animated_image() will return the
+ // original |raw_image| and raw_image() will return the encoded representation
+ // of |image|.
UserImage(const gfx::ImageSkia& image, const RawImage& raw_image);
virtual ~UserImage();
@@ -45,6 +49,10 @@
// Discards the stored raw image, freeing used memory.
void DiscardRawImage();
+
+ // Optional raw representation of the animated image.
+ bool has_animated_image() const { return has_animated_image_; }
+ const RawImage& animated_image() const { return animated_image_; }
// URL from which this image was originally downloaded, if any.
void set_url(const GURL& url) { url_ = url; }
@@ -62,6 +70,8 @@
gfx::ImageSkia image_;
bool has_raw_image_;
RawImage raw_image_;
+ bool has_animated_image_;
+ RawImage animated_image_;
GURL url_;
// If image was loaded from the local file, file path is stored here.
« no previous file with comments | « chrome/browser/ui/webui/options/chromeos/user_image_source.cc ('k') | components/user_manager/user_image/user_image.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698