OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_USERS_AVATAR_USER_IMAGE_H_ | 5 #ifndef COMPONENTS_USER_MANAGER_USER_IMAGE_USER_IMAGE_H_ |
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_USERS_AVATAR_USER_IMAGE_H_ | 6 #define COMPONENTS_USER_MANAGER_USER_IMAGE_USER_IMAGE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
| 11 #include "components/user_manager/user_manager_export.h" |
11 #include "ui/gfx/image/image_skia.h" | 12 #include "ui/gfx/image/image_skia.h" |
12 #include "url/gurl.h" | 13 #include "url/gurl.h" |
13 | 14 |
14 namespace chromeos { | 15 namespace user_manager { |
15 | 16 |
16 // Wrapper class storing a still image and it's raw representation. Could be | 17 // Wrapper class storing a still image and it's raw representation. Could be |
17 // used for storing profile images (including animated profile images) and user | 18 // used for storing profile images (including animated profile images) and user |
18 // wallpapers. | 19 // wallpapers. |
19 class UserImage { | 20 class USER_MANAGER_EXPORT UserImage { |
20 public: | 21 public: |
21 // TODO(ivankr): replace with RefCountedMemory to prevent copying. | 22 // TODO(ivankr): replace with RefCountedMemory to prevent copying. |
22 typedef std::vector<unsigned char> RawImage; | 23 typedef std::vector<unsigned char> RawImage; |
23 | 24 |
24 // Creates a new instance from a given still frame and tries to encode raw | 25 // Creates a new instance from a given still frame and tries to encode raw |
25 // representation for it. | 26 // representation for it. |
26 // TODO(ivankr): remove eventually. | 27 // TODO(ivankr): remove eventually. |
27 static UserImage CreateAndEncode(const gfx::ImageSkia& image); | 28 static UserImage CreateAndEncode(const gfx::ImageSkia& image); |
28 | 29 |
29 // Create instance with an empty still frame and no raw data. | 30 // Create instance with an empty still frame and no raw data. |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 RawImage raw_image_; | 72 RawImage raw_image_; |
72 bool has_animated_image_; | 73 bool has_animated_image_; |
73 RawImage animated_image_; | 74 RawImage animated_image_; |
74 GURL url_; | 75 GURL url_; |
75 | 76 |
76 // If image was loaded from the local file, file path is stored here. | 77 // If image was loaded from the local file, file path is stored here. |
77 std::string file_path_; | 78 std::string file_path_; |
78 bool is_safe_format_; | 79 bool is_safe_format_; |
79 }; | 80 }; |
80 | 81 |
81 } // namespace chromeos | 82 } // namespace user_manager |
82 | 83 |
83 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USERS_AVATAR_USER_IMAGE_H_ | 84 #endif // COMPONENTS_USER_MANAGER_USER_IMAGE_USER_IMAGE_H_ |
OLD | NEW |