summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornoms <noms@chromium.org>2015-01-19 08:05:06 -0800
committerCommit bot <commit-bot@chromium.org>2015-01-19 16:05:50 +0000
commitc941ac15694723f0e0117ffd70531f623956d46e (patch)
tree3dfb978033bbcfc7f184923722c816c7fc22313a
parent0515336a0095fb9a1046eeffd94d0220669d779e (diff)
downloadchromium_src-c941ac15694723f0e0117ffd70531f623956d46e.zip
chromium_src-c941ac15694723f0e0117ffd70531f623956d46e.tar.gz
chromium_src-c941ac15694723f0e0117ffd70531f623956d46e.tar.bz2
[Resources] Add profile-sized assets for the generic placeholder.
The small, non-high res avatars are 38x31px assets, while the large generic placeholder is a square, which means that when displayed in the profile editing grid, it looks stretched out. BUG=438320 Review URL: https://codereview.chromium.org/854433003 Cr-Commit-Position: refs/heads/master@{#312122}
-rw-r--r--chrome/app/theme/default_100_percent/common/profile_avatar_placeholder.pngbin1021 -> 642 bytes
-rw-r--r--chrome/app/theme/default_100_percent/common/profile_avatar_placeholder_large.pngbin0 -> 1021 bytes
-rw-r--r--chrome/app/theme/default_200_percent/common/profile_avatar_placeholder.pngbin2011 -> 1359 bytes
-rw-r--r--chrome/app/theme/default_200_percent/common/profile_avatar_placeholder_large.pngbin0 -> 2011 bytes
-rw-r--r--chrome/app/theme/theme_resources.grd1
-rw-r--r--chrome/browser/profiles/profile_avatar_icon_util.cc2
-rw-r--r--chrome/browser/profiles/profile_info_cache.cc8
7 files changed, 8 insertions, 3 deletions
diff --git a/chrome/app/theme/default_100_percent/common/profile_avatar_placeholder.png b/chrome/app/theme/default_100_percent/common/profile_avatar_placeholder.png
index 9f7fba5..0a98c3e 100644
--- a/chrome/app/theme/default_100_percent/common/profile_avatar_placeholder.png
+++ b/chrome/app/theme/default_100_percent/common/profile_avatar_placeholder.png
Binary files differ
diff --git a/chrome/app/theme/default_100_percent/common/profile_avatar_placeholder_large.png b/chrome/app/theme/default_100_percent/common/profile_avatar_placeholder_large.png
new file mode 100644
index 0000000..9f7fba5
--- /dev/null
+++ b/chrome/app/theme/default_100_percent/common/profile_avatar_placeholder_large.png
Binary files differ
diff --git a/chrome/app/theme/default_200_percent/common/profile_avatar_placeholder.png b/chrome/app/theme/default_200_percent/common/profile_avatar_placeholder.png
index 0989209..e9c4334 100644
--- a/chrome/app/theme/default_200_percent/common/profile_avatar_placeholder.png
+++ b/chrome/app/theme/default_200_percent/common/profile_avatar_placeholder.png
Binary files differ
diff --git a/chrome/app/theme/default_200_percent/common/profile_avatar_placeholder_large.png b/chrome/app/theme/default_200_percent/common/profile_avatar_placeholder_large.png
new file mode 100644
index 0000000..0989209
--- /dev/null
+++ b/chrome/app/theme/default_200_percent/common/profile_avatar_placeholder_large.png
Binary files differ
diff --git a/chrome/app/theme/theme_resources.grd b/chrome/app/theme/theme_resources.grd
index 08712b15..018b4c4 100644
--- a/chrome/app/theme/theme_resources.grd
+++ b/chrome/app/theme/theme_resources.grd
@@ -691,6 +691,7 @@
<structure type="chrome_scaled_image" name="IDR_PROFILE_AVATAR_24" file="common/profile_avatar_note_mac.png" />
<structure type="chrome_scaled_image" name="IDR_PROFILE_AVATAR_25" file="common/profile_avatar_sun_cloud_mac.png" />
<structure type="chrome_scaled_image" name="IDR_PROFILE_AVATAR_26" file="common/profile_avatar_placeholder.png" />
+ <structure type="chrome_scaled_image" name="IDR_PROFILE_AVATAR_PLACEHOLDER_LARGE" file="common/profile_avatar_placeholder_large.png" />
<!-- New style avatar button -->
<if expr="toolkit_views and not is_macosx">
diff --git a/chrome/browser/profiles/profile_avatar_icon_util.cc b/chrome/browser/profiles/profile_avatar_icon_util.cc
index 491f640..40bd368 100644
--- a/chrome/browser/profiles/profile_avatar_icon_util.cc
+++ b/chrome/browser/profiles/profile_avatar_icon_util.cc
@@ -305,7 +305,7 @@ int GetPlaceholderAvatarIndex() {
}
int GetPlaceholderAvatarIconResourceID() {
- return IDR_PROFILE_AVATAR_26;
+ return IDR_PROFILE_AVATAR_PLACEHOLDER_LARGE;
}
const IconResourceInfo* GetDefaultAvatarIconResourceInfo(size_t index) {
diff --git a/chrome/browser/profiles/profile_info_cache.cc b/chrome/browser/profiles/profile_info_cache.cc
index 6ba81df..4a4eb9c 100644
--- a/chrome/browser/profiles/profile_info_cache.cc
+++ b/chrome/browser/profiles/profile_info_cache.cc
@@ -1024,8 +1024,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);