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

Unified Diff: chrome/browser/ui/webui/options/managed_user_import_handler.cc

Issue 23523038: Display supervised users synced avatars in the import overlay (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@avatar_sync_2
Patch Set: bauerb@ + Created 7 years, 3 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/managed_mode/managed_user_sync_service_unittest.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/options/managed_user_import_handler.cc
diff --git a/chrome/browser/ui/webui/options/managed_user_import_handler.cc b/chrome/browser/ui/webui/options/managed_user_import_handler.cc
index 67f3523827bff6ee43ec4e6c3db2932d27edfb47..3f1b85844150c7f5930a4525635324225edbdd04 100644
--- a/chrome/browser/ui/webui/options/managed_user_import_handler.cc
+++ b/chrome/browser/ui/webui/options/managed_user_import_handler.cc
@@ -69,15 +69,23 @@ void ManagedUserImportHandler::RequestExistingManagedUsers(
bool success = it.value().GetAsDictionary(&value);
DCHECK(success);
std::string name;
- value->GetString("name", &name);
+ value->GetString(ManagedUserSyncService::kName, &name);
+ std::string avatar_str;
+ value->GetString(ManagedUserSyncService::kChromeAvatar, &avatar_str);
DictionaryValue* managed_user = new DictionaryValue;
managed_user->SetString("id", it.key());
managed_user->SetString("name", name);
- // TODO(ibraaaa): Update this to use the correct avatar
- // when avatar syncing is implemented: http://crbug.com/278083
- std::string avatar_url = ProfileInfoCache::GetDefaultAvatarIconUrl(0);
+ int avatar_index = -1;
+ success = ManagedUserSyncService::GetAvatarIndex(avatar_str, &avatar_index);
+ DCHECK(success);
+
+ // TODO(ibraaaa): When we have an image indicating that this user
+ // has no synced avatar then change this to use it.
+ avatar_index = avatar_index < 0 ? 0 : avatar_index;
+ std::string avatar_url =
+ ProfileInfoCache::GetDefaultAvatarIconUrl(avatar_index);
managed_user->SetString("iconURL", avatar_url);
bool on_current_device =
managed_user_ids.find(it.key()) != managed_user_ids.end();
« no previous file with comments | « chrome/browser/managed_mode/managed_user_sync_service_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698