| Index: chrome/browser/profiles/profile_info_cache.cc
|
| diff --git a/chrome/browser/profiles/profile_info_cache.cc b/chrome/browser/profiles/profile_info_cache.cc
|
| index 8c357878a0fbb764a48a9a991b04d18d24bada21..7901f0444befb43e36dda0ad6c0e7db75848ac26 100644
|
| --- a/chrome/browser/profiles/profile_info_cache.cc
|
| +++ b/chrome/browser/profiles/profile_info_cache.cc
|
| @@ -89,8 +89,12 @@ const int kDefaultAvatarIconResources[] = {
|
| IDR_PROFILE_AVATAR_23,
|
| IDR_PROFILE_AVATAR_24,
|
| IDR_PROFILE_AVATAR_25,
|
| + IDR_PROFILE_AVATAR_26,
|
| };
|
|
|
| +// This avatar does not exist on the server, the high res copy is in the build.
|
| +const char* kNoHighResAvatar = "NothingToDownload";
|
| +
|
| // File names for the high-res avatar icon resources. In the same order as
|
| // the avatars in kDefaultAvatarIconResources.
|
| const char* kDefaultAvatarIconResourceFileNames[] = {
|
| @@ -120,6 +124,7 @@ const char* kDefaultAvatarIconResourceFileNames[] = {
|
| "avatar_margarita.png",
|
| "avatar_note.png",
|
| "avatar_sun_cloud.png",
|
| + kNoHighResAvatar,
|
| };
|
|
|
| const size_t kDefaultAvatarIconsCount = arraysize(kDefaultAvatarIconResources);
|
| @@ -127,6 +132,9 @@ const size_t kDefaultAvatarIconsCount = arraysize(kDefaultAvatarIconResources);
|
| // The first 8 icons are generic.
|
| const size_t kGenericIconCount = 8;
|
|
|
| +// The avatar used as a placeholder (grey silhouette).
|
| +const int kPlaceholderAvatarIcon = 26;
|
| +
|
| // First eight are generic icons, which use IDS_NUMBERED_PROFILE_NAME.
|
| const int kDefaultNames[] = {
|
| IDS_DEFAULT_AVATAR_NAME_8,
|
| @@ -146,7 +154,8 @@ const int kDefaultNames[] = {
|
| IDS_DEFAULT_AVATAR_NAME_22,
|
| IDS_DEFAULT_AVATAR_NAME_23,
|
| IDS_DEFAULT_AVATAR_NAME_24,
|
| - IDS_DEFAULT_AVATAR_NAME_25
|
| + IDS_DEFAULT_AVATAR_NAME_25,
|
| + IDS_DEFAULT_AVATAR_NAME_26
|
| };
|
|
|
| typedef std::vector<unsigned char> ImageData;
|
| @@ -464,6 +473,9 @@ const gfx::Image* ProfileInfoCache::GetHighResAvatarOfProfileAtIndex(
|
| int avatar_index = GetAvatarIconIndexOfProfileAtIndex(index);
|
| std::string key = kDefaultAvatarIconResourceFileNames[avatar_index];
|
|
|
| + if (!strcmp(key.c_str(), kNoHighResAvatar))
|
| + return NULL;
|
| +
|
| base::FilePath user_data_dir;
|
| PathService::Get(chrome::DIR_USER_DATA, &user_data_dir);
|
| base::FilePath image_path =
|
| @@ -930,6 +942,15 @@ size_t ProfileInfoCache::GetDefaultAvatarIconCount() {
|
| return kDefaultAvatarIconsCount;
|
| }
|
|
|
| +
|
| +int ProfileInfoCache::GetPlaceholderAvatarIndex() {
|
| + return kPlaceholderAvatarIcon;
|
| +}
|
| +
|
| +int ProfileInfoCache::GetPlaceholderAvatarIconResourceID() {
|
| + return IDR_PROFILE_AVATAR_26;
|
| +}
|
| +
|
| // static
|
| int ProfileInfoCache::GetDefaultAvatarIconResourceIDAtIndex(size_t index) {
|
| DCHECK(IsDefaultAvatarIconIndex(index));
|
|
|