Chromium Code Reviews| 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 1a05aebd7481422bb49cb4f5be2310331ac4650f..e233cb235b1497c0b78c6866a68e794a3e5fcd26 100644 |
| --- a/components/user_manager/user_image/user_image.h |
| +++ b/components/user_manager/user_image/user_image.h |
| @@ -15,43 +15,46 @@ |
| namespace user_manager { |
| -// Wrapper class storing a still image and it's raw representation. Could be |
| -// used for storing profile images and user wallpapers. |
| +// Wrapper class storing a still image and it's web representation in a |
|
hashimoto
2016/02/29 08:01:59
s/it's/its/?
satorux1
2016/02/29 08:11:41
Done.
|
| +// web-compatible format such as JPEG. Could be used for storing profile |
| +// images and user wallpapers. |
| class USER_MANAGER_EXPORT UserImage { |
| public: |
| + // Used to store data bytes of web representation. |
| // TODO(ivankr): replace with RefCountedMemory to prevent copying. |
| - typedef std::vector<unsigned char> RawImage; |
| + typedef std::vector<unsigned char> WebImage; |
|
hashimoto
2016/02/29 08:01:59
I'm not sure if WebImage is better than RawImage.
satorux1
2016/02/29 08:11:41
It's not always the case. RawImage is generated fr
hashimoto
2016/02/29 10:03:19
Removing typedef doesn't sound like a good thing t
satorux1
2016/02/29 11:07:49
How about just Bytes? This might sound too generic
hashimoto
2016/03/01 05:59:10
Bytes as a type name sounds sufficiently boring to
satorux1
2016/03/01 07:37:04
Done!
|
| - // Creates a new instance from a given still frame and tries to encode raw |
| - // representation for it. |
| + // Creates a new instance from a given still frame and tries to encode it |
| + // to web representation. |
| // TODO(ivankr): remove eventually. |
| static UserImage CreateAndEncode(const gfx::ImageSkia& image); |
| - // Create instance with an empty still frame and no raw data. |
| + // Create instance with an empty still frame and no web representation. |
| UserImage(); |
| - // Creates a new instance from a given still frame without any raw data. |
| + // Creates a new instance from a given still frame without any web |
| + // representation. |
| explicit UserImage(const gfx::ImageSkia& image); |
| - // Creates a new instance from a given still frame and raw representation. |
| - UserImage(const gfx::ImageSkia& image, const RawImage& raw_image); |
| + // Creates a new instance from a given still frame and web representation. |
| + UserImage(const gfx::ImageSkia& image, const WebImage& web_image); |
| virtual ~UserImage(); |
| const gfx::ImageSkia& image() const { return image_; } |
| - // Optional raw representation of the still image. |
| - bool has_raw_image() const { return has_raw_image_; } |
| - const RawImage& raw_image() const { return raw_image_; } |
| + // Optional web representation of the still image. |
| + bool has_web_image() const { return has_web_image_; } |
| + const WebImage& web_image() const { return web_image_; } |
| - // Discards the stored raw image, freeing used memory. |
| - void DiscardRawImage(); |
| + // Discards the stored web image, freeing used memory. |
| + void DiscardWebImage(); |
| // URL from which this image was originally downloaded, if any. |
| void set_url(const GURL& url) { url_ = url; } |
| GURL url() const { return url_; } |
| - // Whether |raw_image| contains data in format that is considered safe to |
| + // Whether |web_image| contains data in format that is considered safe to |
| // decode in sensitive environment (on Login screen). |
| bool is_safe_format() const { return is_safe_format_; } |
| void MarkAsSafe(); |
| @@ -63,8 +66,8 @@ class USER_MANAGER_EXPORT UserImage { |
| private: |
| gfx::ImageSkia image_; |
| - bool has_raw_image_; |
| - RawImage raw_image_; |
| + bool has_web_image_; |
| + WebImage web_image_; |
| GURL url_; |
| // If image was loaded from the local file, file path is stored here. |