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_PROFILES_PROFILE_AVATAR_ICON_UTIL_H_ | 5 #ifndef CHROME_BROWSER_PROFILES_PROFILE_AVATAR_ICON_UTIL_H_ |
6 #define CHROME_BROWSER_PROFILES_PROFILE_AVATAR_ICON_UTIL_H_ | 6 #define CHROME_BROWSER_PROFILES_PROFILE_AVATAR_ICON_UTIL_H_ |
7 | 7 |
| 8 #include <string> |
| 9 |
8 #include "third_party/skia/include/core/SkColor.h" | 10 #include "third_party/skia/include/core/SkColor.h" |
9 #include "ui/gfx/image/image.h" | 11 |
| 12 namespace base { |
| 13 class FilePath; |
| 14 } |
| 15 |
| 16 namespace gfx { |
| 17 class Image; |
| 18 } |
10 | 19 |
11 namespace profiles { | 20 namespace profiles { |
12 | 21 |
13 // Avatar access. | 22 // Avatar access. |
14 extern const char kGAIAPictureFileName[]; | 23 extern const char kGAIAPictureFileName[]; |
15 extern const char kHighResAvatarFolderName[]; | 24 extern const char kHighResAvatarFolderName[]; |
16 | 25 |
17 // Avatar formatting. | 26 // Avatar formatting. |
18 extern const int kAvatarIconWidth; | 27 extern const int kAvatarIconWidth; |
19 extern const int kAvatarIconHeight; | 28 extern const int kAvatarIconHeight; |
(...skipping 16 matching lines...) Expand all Loading... |
36 | 45 |
37 // Gets the resource ID of the default avatar icon at |index|. | 46 // Gets the resource ID of the default avatar icon at |index|. |
38 int GetDefaultAvatarIconResourceIDAtIndex(size_t index); | 47 int GetDefaultAvatarIconResourceIDAtIndex(size_t index); |
39 | 48 |
40 // Gets the resource filename of the default avatar icon at |index|. | 49 // Gets the resource filename of the default avatar icon at |index|. |
41 const char* GetDefaultAvatarIconFileNameAtIndex(size_t index); | 50 const char* GetDefaultAvatarIconFileNameAtIndex(size_t index); |
42 | 51 |
43 // Gets the file name of an avatar that has no high res version. | 52 // Gets the file name of an avatar that has no high res version. |
44 const char* GetNoHighResAvatarFileName(); | 53 const char* GetNoHighResAvatarFileName(); |
45 | 54 |
| 55 // Gets the full path of the high res avatar icon at |index|. |
| 56 base::FilePath GetPathOfHighResAvatarAtIndex(size_t index); |
| 57 |
46 // Returns a URL for the default avatar icon with specified index. | 58 // Returns a URL for the default avatar icon with specified index. |
47 std::string GetDefaultAvatarIconUrl(size_t index); | 59 std::string GetDefaultAvatarIconUrl(size_t index); |
48 | 60 |
49 // Checks if |index| is a valid avatar icon index | 61 // Checks if |index| is a valid avatar icon index |
50 bool IsDefaultAvatarIconIndex(size_t index); | 62 bool IsDefaultAvatarIconIndex(size_t index); |
51 | 63 |
52 // Checks if the given URL points to one of the default avatar icons. If it | 64 // Checks if the given URL points to one of the default avatar icons. If it |
53 // is, returns true and its index through |icon_index|. If not, returns false. | 65 // is, returns true and its index through |icon_index|. If not, returns false. |
54 bool IsDefaultAvatarIconUrl(const std::string& icon_url, size_t *icon_index); | 66 bool IsDefaultAvatarIconUrl(const std::string& icon_url, size_t *icon_index); |
55 // Returns a version of |image| of a specific size. Note that no checks are | 67 // Returns a version of |image| of a specific size. Note that no checks are |
(...skipping 14 matching lines...) Expand all Loading... |
70 // Returns a version of |image| suitable for use in title bars. The returned | 82 // Returns a version of |image| suitable for use in title bars. The returned |
71 // image is scaled to fit |dst_width| and |dst_height|. | 83 // image is scaled to fit |dst_width| and |dst_height|. |
72 gfx::Image GetAvatarIconForTitleBar(const gfx::Image& image, | 84 gfx::Image GetAvatarIconForTitleBar(const gfx::Image& image, |
73 bool is_rectangle, | 85 bool is_rectangle, |
74 int dst_width, | 86 int dst_width, |
75 int dst_height); | 87 int dst_height); |
76 | 88 |
77 } // namespace profiles | 89 } // namespace profiles |
78 | 90 |
79 #endif // CHROME_BROWSER_PROFILES_PROFILE_AVATAR_ICON_UTIL_H_ | 91 #endif // CHROME_BROWSER_PROFILES_PROFILE_AVATAR_ICON_UTIL_H_ |
OLD | NEW |