| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_USER_IMAGE_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_USER_IMAGE_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_USER_IMAGE_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_USER_IMAGE_H_ |
| 7 | 7 |
| 8 #include <string> |
| 8 #include <vector> | 9 #include <vector> |
| 9 | 10 |
| 10 #include "ui/gfx/image/image_skia.h" | 11 #include "ui/gfx/image/image_skia.h" |
| 11 #include "url/gurl.h" | 12 #include "url/gurl.h" |
| 12 | 13 |
| 13 namespace chromeos { | 14 namespace chromeos { |
| 14 | 15 |
| 15 // Wrapper class storing a still image and it's raw representation. Could be | 16 // Wrapper class storing a still image and it's raw representation. Could be |
| 16 // used for storing profile images (including animated profile images) and user | 17 // used for storing profile images (including animated profile images) and user |
| 17 // wallpapers. | 18 // wallpapers. |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 | 55 |
| 55 // URL from which this image was originally downloaded, if any. | 56 // URL from which this image was originally downloaded, if any. |
| 56 void set_url(const GURL& url) { url_ = url; } | 57 void set_url(const GURL& url) { url_ = url; } |
| 57 GURL url() const { return url_; } | 58 GURL url() const { return url_; } |
| 58 | 59 |
| 59 // Whether |raw_image| contains data in format that is considered safe to | 60 // Whether |raw_image| contains data in format that is considered safe to |
| 60 // decode in sensitive environment (on Login screen). | 61 // decode in sensitive environment (on Login screen). |
| 61 bool is_safe_format() const { return is_safe_format_; } | 62 bool is_safe_format() const { return is_safe_format_; } |
| 62 void MarkAsSafe(); | 63 void MarkAsSafe(); |
| 63 | 64 |
| 65 const std::string& file_path() const { return file_path_; } |
| 66 void set_file_path(const std::string& file_path) { file_path_ = file_path; } |
| 67 |
| 64 private: | 68 private: |
| 65 gfx::ImageSkia image_; | 69 gfx::ImageSkia image_; |
| 66 bool has_raw_image_; | 70 bool has_raw_image_; |
| 67 RawImage raw_image_; | 71 RawImage raw_image_; |
| 68 bool has_animated_image_; | 72 bool has_animated_image_; |
| 69 RawImage animated_image_; | 73 RawImage animated_image_; |
| 70 GURL url_; | 74 GURL url_; |
| 75 |
| 76 // If image was loaded from the local file, file path is stored here. |
| 77 std::string file_path_; |
| 71 bool is_safe_format_; | 78 bool is_safe_format_; |
| 72 }; | 79 }; |
| 73 | 80 |
| 74 } // namespace chromeos | 81 } // namespace chromeos |
| 75 | 82 |
| 76 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USER_IMAGE_H_ | 83 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USER_IMAGE_H_ |
| OLD | NEW |