Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1392)

Unified Diff: chrome/browser/profiles/profile_info_cache.cc

Issue 854433003: [Resources] Add profile-sized assets for the generic placeholder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: match variable name to asset file name Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/profiles/profile_avatar_icon_util.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 4e6803e2ceb57727fbdd9386df1918ab01c384ac..e5736679d36d3a6c5f09915e730f4817b27389b0 100644
--- a/chrome/browser/profiles/profile_info_cache.cc
+++ b/chrome/browser/profiles/profile_info_cache.cc
@@ -1006,8 +1006,12 @@ const gfx::Image* ProfileInfoCache::GetHighResAvatarOfProfileAtIndex(
int avatar_index = GetAvatarIconIndexOfProfileAtIndex(index);
std::string key = profiles::GetDefaultAvatarIconFileNameAtIndex(avatar_index);
- if (!strcmp(key.c_str(), profiles::GetNoHighResAvatarFileName()))
- return NULL;
+ // If this is the placeholder avatar, it is already included in the
+ // resources, so it doesn't need to be downloaded.
+ if (!strcmp(key.c_str(), profiles::GetNoHighResAvatarFileName())) {
+ return &ui::ResourceBundle::GetSharedInstance().GetImageNamed(
+ profiles::GetPlaceholderAvatarIconResourceID());
+ }
base::FilePath image_path =
profiles::GetPathOfHighResAvatarAtIndex(avatar_index);
« no previous file with comments | « chrome/browser/profiles/profile_avatar_icon_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698