Index: chrome/browser/chromeos/login/user_image.h |
diff --git a/chrome/browser/chromeos/login/user_image.h b/chrome/browser/chromeos/login/user_image.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..a9f9f3837c006736b023258d28817dc6fb003c7d |
--- /dev/null |
+++ b/chrome/browser/chromeos/login/user_image.h |
@@ -0,0 +1,48 @@ |
+// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CHROME_BROWSER_CHROMEOS_LOGIN_USER_IMAGE_H_ |
+#define CHROME_BROWSER_CHROMEOS_LOGIN_USER_IMAGE_H_ |
+#pragma once |
+ |
+#include <vector> |
+ |
+#include "third_party/skia/include/core/SkBitmap.h" |
+ |
+namespace chromeos { |
+ |
+// Wrapper class for bitmaps and raw images when it's necessary. Could |
+// be used for storing profile images (including animated profile |
+// images) and user wallpapers. |
+class UserImage { |
+ public: |
+ typedef std::vector<unsigned char> RawImage; |
+ |
+ // Constructs UserImage from bitmap. Should be used where only |
+ // static image is needed (e.g. wallpapers). |
+ explicit UserImage(const SkBitmap& image); |
+ |
+ // Constructs UserImage from raw image and bitmap that should |
+ // represent single frame from that one. Can be used for wrapping |
+ // animated images. |
+ UserImage(const SkBitmap& image, const RawImage& raw_image); |
+ |
+ virtual ~UserImage(); |
+ |
+ void SetImage(const SkBitmap& image); |
+ const SkBitmap& image() const { return image_; } |
+ bool has_raw_image() const { return has_raw_image_; } |
+ bool has_animated_image() const { return has_animated_image_; } |
+ const RawImage& raw_image() const { return raw_image_; } |
+ |
+ private: |
+ SkBitmap image_; |
+ bool has_raw_image_; |
+ bool has_animated_image_; |
+ RawImage raw_image_; |
+}; |
+ |
+} // namespace chromeos |
+ |
+#endif // CHROME_BROWSER_CHROMEOS_LOGIN_USER_IMAGE_H_ |