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

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

Issue 23691045: Update managed user registration to allow updating the avatar (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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 3f1b85844150c7f5930a4525635324225edbdd04..3cb856dd1210d5849cfa332a4dc26f4556853019 100644
--- a/chrome/browser/ui/webui/options/managed_user_import_handler.cc
+++ b/chrome/browser/ui/webui/options/managed_user_import_handler.cc
@@ -77,13 +77,14 @@ void ManagedUserImportHandler::RequestExistingManagedUsers(
managed_user->SetString("id", it.key());
managed_user->SetString("name", name);
- int avatar_index = -1;
+ int avatar_index = ManagedUserSyncService::kNoAvatar;
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;
+ avatar_index =
+ avatar_index == ManagedUserSyncService::kNoAvatar ? 0 : avatar_index;
std::string avatar_url =
ProfileInfoCache::GetDefaultAvatarIconUrl(avatar_index);
managed_user->SetString("iconURL", avatar_url);
« 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