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

Unified Diff: chrome/browser/ui/webui/settings/profile_info_handler.cc

Issue 2807373003: MD Settings: get the avatar icon the same way the user switcher does (Closed)
Patch Set: dschuyler@ review Created 3 years, 8 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 | « no previous file | chrome/browser/ui/webui/settings/profile_info_handler_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/settings/profile_info_handler.cc
diff --git a/chrome/browser/ui/webui/settings/profile_info_handler.cc b/chrome/browser/ui/webui/settings/profile_info_handler.cc
index 5bb0e952d00df355d912306c9ff4f349cf2c6e53..17f8fc7fe679ce14d1fde74df9eff660f0446d52 100644
--- a/chrome/browser/ui/webui/settings/profile_info_handler.cc
+++ b/chrome/browser/ui/webui/settings/profile_info_handler.cc
@@ -206,15 +206,13 @@ ProfileInfoHandler::GetAccountNameAndIcon() const {
->GetProfileAttributesStorage()
.GetProfileAttributesWithPath(profile_->GetPath(), &entry)) {
name = base::UTF16ToUTF8(entry->GetName());
-
- if (entry->IsUsingGAIAPicture() && entry->GetGAIAPicture()) {
- constexpr int kAvatarIconSize = 40;
- gfx::Image icon = profiles::GetSizedAvatarIcon(
- entry->GetAvatarIcon(), true, kAvatarIconSize, kAvatarIconSize);
- icon_url = webui::GetBitmapDataUrl(icon.AsBitmap());
- } else {
- icon_url = profiles::GetDefaultAvatarIconUrl(entry->GetAvatarIconIndex());
- }
+ // TODO(crbug.com/710660): return chrome://theme/IDR_PROFILE_AVATAR_*
+ // and update theme_source.cc to get high res avatar icons. This does less
+ // work here, sends less over IPC, and is more stable with returned results.
+ constexpr int kAvatarIconSize = 40;
+ gfx::Image icon = profiles::GetSizedAvatarIcon(
+ entry->GetAvatarIcon(), true, kAvatarIconSize, kAvatarIconSize);
+ icon_url = webui::GetBitmapDataUrl(icon.AsBitmap());
}
#endif // defined(OS_CHROMEOS)
« no previous file with comments | « no previous file | chrome/browser/ui/webui/settings/profile_info_handler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698