Commit d9f8de4a authored by Thomas Lukaszewicz's avatar Thomas Lukaszewicz Committed by Commit Bot

Revert "Updated profile icons to render as circles in the Mac people menu"

This reverts commit 0cb19df2.

Reason for revert:
Reverted change due to transparency issues when using older profile icons.
See https://bugs.chromium.org/p/chromium/issues/detail?id=1016334

Bug: 857064,1016334
Change-Id: I9f35f0692c733f1a7544249581104006f0673642
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1913465Reviewed-by: default avatarDavid Roger <droger@chromium.org>
Commit-Queue: Thomas Lukaszewicz <tluk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#715316}
parent 91f1dd4b
......@@ -44,8 +44,12 @@ AvatarMenu::ImageLoadStatus AvatarMenu::GetImageForMenuButton(
status = ImageLoadStatus::LOADING;
}
// Otherwise, use the high resolution icon from local storage.
*image = entry->GetAvatarIcon();
// Otherwise, use the default resource, not the downloaded high-res one.
const size_t icon_index = entry->GetAvatarIconIndex();
const int resource_id =
profiles::GetDefaultAvatarIconResourceIDAtIndex(icon_index);
*image =
ui::ResourceBundle::GetSharedInstance().GetNativeImageNamed(resource_id);
return status;
}
......@@ -399,12 +399,15 @@ gfx::Image GetAvatarIconForNSMenu(const base::FilePath& profile_path) {
gfx::Image icon;
AvatarMenu::GetImageForMenuButton(profile_path, &icon);
// Shape the avatar icon into a circle for consistency with other avatar
// UI elements.
// The image might be too large and need to be resized, e.g. if this is a
// signed-in user using the GAIA profile photo.
constexpr int kMenuAvatarIconSize = 38;
return profiles::GetSizedAvatarIcon(icon, /*is_rectangle=*/true,
kMenuAvatarIconSize, kMenuAvatarIconSize,
profiles::SHAPE_CIRCLE);
if (icon.Width() > kMenuAvatarIconSize ||
icon.Height() > kMenuAvatarIconSize) {
icon = profiles::GetSizedAvatarIcon(
icon, /*is_rectangle=*/true, kMenuAvatarIconSize, kMenuAvatarIconSize);
}
return icon;
}
#endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment