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> | 8 #include <string> |
9 | 9 |
10 #include "third_party/skia/include/core/SkColor.h" | 10 #include "third_party/skia/include/core/SkColor.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 // so that when resized to a square aspect ratio it looks pretty. | 60 // so that when resized to a square aspect ratio it looks pretty. |
61 SkBitmap GetAvatarIconAsSquare(const SkBitmap& source_bitmap, int scale_factor); | 61 SkBitmap GetAvatarIconAsSquare(const SkBitmap& source_bitmap, int scale_factor); |
62 | 62 |
63 // Gets the number of default avatar icons that exist. | 63 // Gets the number of default avatar icons that exist. |
64 size_t GetDefaultAvatarIconCount(); | 64 size_t GetDefaultAvatarIconCount(); |
65 | 65 |
66 // Gets the number of generic avatar icons that exist. | 66 // Gets the number of generic avatar icons that exist. |
67 size_t GetGenericAvatarIconCount(); | 67 size_t GetGenericAvatarIconCount(); |
68 | 68 |
69 // Gets the index for the (grey silhouette) avatar used as a placeholder. | 69 // Gets the index for the (grey silhouette) avatar used as a placeholder. |
70 int GetPlaceholderAvatarIndex(); | 70 size_t GetPlaceholderAvatarIndex(); |
71 | 71 |
72 // Gets the resource ID of the placeholder avatar icon. | 72 // Gets the resource ID of the placeholder avatar icon. |
73 int GetPlaceholderAvatarIconResourceID(); | 73 int GetPlaceholderAvatarIconResourceID(); |
74 | 74 |
75 // Gets the resource ID of the default avatar icon at |index|. | 75 // Gets the resource ID of the default avatar icon at |index|. |
76 int GetDefaultAvatarIconResourceIDAtIndex(size_t index); | 76 int GetDefaultAvatarIconResourceIDAtIndex(size_t index); |
77 | 77 |
78 // Gets the resource filename of the default avatar icon at |index|. | 78 // Gets the resource filename of the default avatar icon at |index|. |
79 const char* GetDefaultAvatarIconFileNameAtIndex(size_t index); | 79 const char* GetDefaultAvatarIconFileNameAtIndex(size_t index); |
80 | 80 |
81 // Gets the file name of an avatar that has no high res version. | |
82 const char* GetNoHighResAvatarFileName(); | |
83 | |
84 // Gets the full path of the high res avatar icon at |index|. | 81 // Gets the full path of the high res avatar icon at |index|. |
85 base::FilePath GetPathOfHighResAvatarAtIndex(size_t index); | 82 base::FilePath GetPathOfHighResAvatarAtIndex(size_t index); |
86 | 83 |
87 // Returns a URL for the default avatar icon with specified index. | 84 // Returns a URL for the default avatar icon with specified index. |
88 std::string GetDefaultAvatarIconUrl(size_t index); | 85 std::string GetDefaultAvatarIconUrl(size_t index); |
89 | 86 |
90 // Checks if |index| is a valid avatar icon index | 87 // Checks if |index| is a valid avatar icon index |
91 bool IsDefaultAvatarIconIndex(size_t index); | 88 bool IsDefaultAvatarIconIndex(size_t index); |
92 | 89 |
93 // Checks if the given URL points to one of the default avatar icons. If it | 90 // Checks if the given URL points to one of the default avatar icons. If it |
94 // is, returns true and its index through |icon_index|. If not, returns false. | 91 // is, returns true and its index through |icon_index|. If not, returns false. |
95 bool IsDefaultAvatarIconUrl(const std::string& icon_url, size_t *icon_index); | 92 bool IsDefaultAvatarIconUrl(const std::string& icon_url, size_t *icon_index); |
96 | 93 |
97 } // namespace profiles | 94 } // namespace profiles |
98 | 95 |
99 #endif // CHROME_BROWSER_PROFILES_PROFILE_AVATAR_ICON_UTIL_H_ | 96 #endif // CHROME_BROWSER_PROFILES_PROFILE_AVATAR_ICON_UTIL_H_ |
OLD | NEW |