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_DEFAULT_USER_IMAGES_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_DEFAULT_USER_IMAGES_H_ |
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_DEFAULT_USER_IMAGES_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_DEFAULT_USER_IMAGES_H_ |
7 | 7 |
8 #include <cstddef> // for size_t | 8 #include <cstddef> // for size_t |
9 #include <string> | 9 #include <string> |
10 | 10 |
| 11 #include "base/string16.h" |
| 12 |
11 namespace gfx { | 13 namespace gfx { |
12 class ImageSkia; | 14 class ImageSkia; |
13 } | 15 } |
14 | 16 |
15 namespace chromeos { | 17 namespace chromeos { |
16 | 18 |
17 // Returns path to default user image with specified index. | 19 // Returns path to default user image with specified index. |
18 // The path is used in Local State to distinguish default images. | 20 // The path is used in Local State to distinguish default images. |
19 // This function is obsolete and is preserved only for compatibility with older | 21 // This function is obsolete and is preserved only for compatibility with older |
20 // profiles which don't user separate image index and path. | 22 // profiles which don't user separate image index and path. |
21 std::string GetDefaultImagePath(int index); | 23 std::string GetDefaultImagePath(int index); |
22 | 24 |
23 // Checks if given path is one of the default ones. If it is, returns true | 25 // Checks if given path is one of the default ones. If it is, returns true |
24 // and its index through |image_id|. If not, returns false. | 26 // and its index through |image_id|. If not, returns false. |
25 bool IsDefaultImagePath(const std::string& path, int* image_id); | 27 bool IsDefaultImagePath(const std::string& path, int* image_id); |
26 | 28 |
27 // Returns URL to default user image with specified index. | 29 // Returns URL to default user image with specified index. |
28 std::string GetDefaultImageUrl(int index); | 30 std::string GetDefaultImageUrl(int index); |
29 | 31 |
30 // Checks if the given URL points to one of the default images. If it is, | 32 // Checks if the given URL points to one of the default images. If it is, |
31 // returns true and its index through |image_id|. If not, returns false. | 33 // returns true and its index through |image_id|. If not, returns false. |
32 bool IsDefaultImageUrl(const std::string url, int* image_id); | 34 bool IsDefaultImageUrl(const std::string url, int* image_id); |
33 | 35 |
34 // Returns bitmap of default user image with specified index. | 36 // Returns bitmap of default user image with specified index. |
35 const gfx::ImageSkia& GetDefaultImage(int index); | 37 const gfx::ImageSkia& GetDefaultImage(int index); |
36 | 38 |
| 39 // Returns a description of a default user image with specified index. |
| 40 string16 GetDefaultImageDescription(int index); |
| 41 |
37 // Resource IDs of default user images. | 42 // Resource IDs of default user images. |
38 extern const int kDefaultImageResourceIDs[]; | 43 extern const int kDefaultImageResourceIDs[]; |
39 | 44 |
40 // String IDs of author names for default user images. | 45 // String IDs of author names for default user images. |
41 extern const int kDefaultImageAuthorIDs[]; | 46 extern const int kDefaultImageAuthorIDs[]; |
42 | 47 |
43 // String IDs of websites for default user images. | 48 // String IDs of websites for default user images. |
44 extern const int kDefaultImageWebsiteIDs[]; | 49 extern const int kDefaultImageWebsiteIDs[]; |
45 | 50 |
46 // Number of default images. | 51 // Number of default images. |
(...skipping 25 matching lines...) Expand all Loading... |
72 | 77 |
73 // Number of possible histogram values for user images. | 78 // Number of possible histogram values for user images. |
74 extern const int kHistogramImagesCount; | 79 extern const int kHistogramImagesCount; |
75 | 80 |
76 // Returns the histogram value corresponding to the given default image index. | 81 // Returns the histogram value corresponding to the given default image index. |
77 int GetDefaultImageHistogramValue(int index); | 82 int GetDefaultImageHistogramValue(int index); |
78 | 83 |
79 } // namespace chromeos | 84 } // namespace chromeos |
80 | 85 |
81 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_DEFAULT_USER_IMAGES_H_ | 86 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_DEFAULT_USER_IMAGES_H_ |
OLD | NEW |