Chromium Code Reviews| Index: chrome/browser/ui/webui/options/chromeos/core_chromeos_options_handler.cc |
| diff --git a/chrome/browser/ui/webui/options/chromeos/core_chromeos_options_handler.cc b/chrome/browser/ui/webui/options/chromeos/core_chromeos_options_handler.cc |
| index 5a8807e19c8de134932e5ff96edee6c850504d8f..44205291a6a5e2dcf0078babb96180317809a1be 100644 |
| --- a/chrome/browser/ui/webui/options/chromeos/core_chromeos_options_handler.cc |
| +++ b/chrome/browser/ui/webui/options/chromeos/core_chromeos_options_handler.cc |
| @@ -17,6 +17,7 @@ |
| #include "chrome/browser/policy/browser_policy_connector.h" |
| #include "chrome/browser/prefs/pref_set_observer.h" |
| #include "chrome/browser/profiles/profile.h" |
| +#include "chrome/browser/ui/webui/options/chromeos/accounts_options_handler.h" |
| #include "chrome/common/chrome_notification_types.h" |
| #include "chrome/common/pref_names.h" |
| #include "content/browser/user_metrics.h" |
| @@ -47,19 +48,18 @@ base::Value* CreateUsersWhitelist(const base::Value *pref_value) { |
| const base::ListValue *list_value = |
| static_cast<const base::ListValue*>(pref_value); |
| base::ListValue *user_list = new base::ListValue(); |
| - |
| - const User& self = UserManager::Get()->logged_in_user(); |
| - bool is_owner = UserManager::Get()->current_user_is_owner(); |
| + UserManager* user_manager = UserManager::Get(); |
| for (base::ListValue::const_iterator i = list_value->begin(); |
| i != list_value->end(); ++i) { |
| std::string email; |
| if ((*i)->GetAsString(&email)) { |
| - DictionaryValue* user = new DictionaryValue; |
| - user->SetString("email", email); |
| - user->SetString("name", ""); |
| - user->SetBoolean("owner", is_owner && email == self.email()); |
| - user_list->Append(user); |
| + // Translate email to the display email. |
| + std::string display_email = user_manager->GetUserDisplayEmail(email); |
| + user_list->Append(AccountsOptionsHandler::CreateUserInfo( |
| + email, display_email, |
| + std::string() // TODO(ivankr): fetch display name for existing users. |
| + )); |
|
whywhat
2011/12/05 12:14:49
Unindent these by 4 spaces
Ivan Korotkov
2011/12/05 14:12:48
Done.
|
| } |
| } |
| return user_list; |