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

Unified Diff: chrome/browser/ui/webui/signin/signin_create_profile_handler.cc

Issue 2066093003: Refactor fetching profile avatar icons and labels repeated md-settings & md-user-manager (C++) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@avatar-selector-refactor
Patch Set: rebase Created 4 years, 6 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/ui/webui/settings/settings_manage_profile_handler.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/signin/signin_create_profile_handler.cc
diff --git a/chrome/browser/ui/webui/signin/signin_create_profile_handler.cc b/chrome/browser/ui/webui/signin/signin_create_profile_handler.cc
index 3f4f27d1c108c7a99324dfb3612d18a403a32f4d..0ac75fffb66535e265dec8a8288eaf7dd08ed268 100644
--- a/chrome/browser/ui/webui/signin/signin_create_profile_handler.cc
+++ b/chrome/browser/ui/webui/signin/signin_create_profile_handler.cc
@@ -173,27 +173,9 @@ void SigninCreateProfileHandler::RegisterMessages() {
void SigninCreateProfileHandler::RequestDefaultProfileIcons(
const base::ListValue* args) {
- base::ListValue image_url_list;
-
- // Add the default avatar icons.
- size_t placeholder_avatar_index = profiles::GetPlaceholderAvatarIndex();
- for (size_t i = 0; i < profiles::GetDefaultAvatarIconCount() &&
- i != placeholder_avatar_index;
- i++) {
- std::unique_ptr<base::DictionaryValue> avatar_info(
- new base::DictionaryValue());
- avatar_info->SetString("url", profiles::GetDefaultAvatarIconUrl(i));
- avatar_info->SetString(
- "label",
- l10n_util::GetStringUTF16(
- profiles::GetDefaultAvatarLabelResourceIDAtIndex(i)));
-
- image_url_list.Append(std::move(avatar_info));
- }
-
web_ui()->CallJavascriptFunctionUnsafe(
"cr.webUIListenerCallback", base::StringValue("profile-icons-received"),
- image_url_list);
+ *profiles::GetDefaultProfileAvatarIconsAndLabels());
SendNewProfileDefaults();
}
« no previous file with comments | « chrome/browser/ui/webui/settings/settings_manage_profile_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698