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

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

Issue 23454020: Update the 'managed user import' overlay to show an avatar selection grid (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@show_synced_avatars_in_import_overlay
Patch Set: rebase 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
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 3cb856dd1210d5849cfa332a4dc26f4556853019..3aac624350854705f1069518f02342b233604288 100644
--- a/chrome/browser/ui/webui/options/managed_user_import_handler.cc
+++ b/chrome/browser/ui/webui/options/managed_user_import_handler.cc
@@ -19,6 +19,20 @@
#include "content/public/browser/web_ui.h"
#include "grit/generated_resources.h"
+namespace {
+
+scoped_ptr<base::ListValue> GetAvatarIcons() {
+ scoped_ptr<base::ListValue> avatar_icons(new base::ListValue);
+ for (size_t i = 0; i < ProfileInfoCache::GetDefaultAvatarIconCount(); ++i) {
+ std::string avatar_url = ProfileInfoCache::GetDefaultAvatarIconUrl(i);
+ avatar_icons->Append(new base::StringValue(avatar_url));
+ }
+
+ return avatar_icons.Pass();
+}
+
+} // namespace
+
namespace options {
ManagedUserImportHandler::ManagedUserImportHandler() {}
@@ -30,17 +44,20 @@ void ManagedUserImportHandler::GetLocalizedValues(
DCHECK(localized_strings);
static OptionsStringResource resources[] = {
+ { "managedUserImportTitle", IDS_IMPORT_EXISTING_MANAGED_USER_TITLE },
{ "managedUserImportText", IDS_IMPORT_EXISTING_MANAGED_USER_TEXT },
{ "createNewUserLink", IDS_CREATE_NEW_USER_LINK },
{ "managedUserImportOk", IDS_IMPORT_EXISTING_MANAGED_USER_OK },
{ "managedUserAlreadyOnThisDevice",
IDS_MANAGED_USER_ALREADY_ON_THIS_DEVICE },
{ "noExistingManagedUsers", IDS_MANAGED_USER_NO_EXISTING_ERROR },
+ { "managedUserSelectAvatarTitle", IDS_MANAGED_USER_SELECT_AVATAR_TITLE },
+ { "managedUserSelectAvatarText", IDS_MANAGED_USER_SELECT_AVATAR_TEXT },
+ { "managedUserSelectAvatarOk", IDS_MANAGED_USER_SELECT_AVATAR_OK },
};
RegisterStrings(localized_strings, resources, arraysize(resources));
- RegisterTitle(localized_strings, "managedUserImport",
- IDS_IMPORT_EXISTING_MANAGED_USER_TITLE);
+ localized_strings->Set("avatarIcons", GetAvatarIcons().release());
}
void ManagedUserImportHandler::RegisterMessages() {
@@ -80,6 +97,7 @@ void ManagedUserImportHandler::RequestExistingManagedUsers(
int avatar_index = ManagedUserSyncService::kNoAvatar;
success = ManagedUserSyncService::GetAvatarIndex(avatar_str, &avatar_index);
DCHECK(success);
+ managed_user->SetBoolean("needAvatar", avatar_index < 0);
// TODO(ibraaaa): When we have an image indicating that this user
// has no synced avatar then change this to use it.

Powered by Google App Engine
This is Rietveld 408576698