| 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..dc1e59937279109c2a334cc957329135ec37c066 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
|
| @@ -43,9 +43,9 @@ base::Value* CreateSettingsValue(base::Value *value,
|
|
|
| // This function decorates the bare list of emails with some more information
|
| // needed by the UI to properly display the Accounts page.
|
| -base::Value* CreateUsersWhitelist(const base::Value *pref_value) {
|
| - const base::ListValue *list_value =
|
| - static_cast<const base::ListValue*>(pref_value);
|
| +base::Value* CreateUsersWhitelist(base::Value *pref_value) {
|
| + scoped_ptr<base::ListValue> list_value(
|
| + static_cast<base::ListValue*>(pref_value));
|
| base::ListValue *user_list = new base::ListValue();
|
|
|
| const User& self = UserManager::Get()->logged_in_user();
|
| @@ -118,20 +118,20 @@ base::Value* CoreChromeOSOptionsHandler::FetchPref(
|
| return ::CoreOptionsHandler::FetchPref(pref_name);
|
| }
|
|
|
| - const base::Value* pref_value =
|
| - CrosSettings::Get()->GetPref(pref_name);
|
| + const base::Value* pref_value = CrosSettings::Get()->GetPref(pref_name);
|
| if (!pref_value)
|
| return base::Value::CreateNullValue();
|
|
|
| // Lists don't get the standard pref decoration.
|
| if (pref_value->GetType() == base::Value::TYPE_LIST) {
|
| if (pref_name == kAccountsPrefUsers)
|
| - return CreateUsersWhitelist(pref_value);
|
| + return CreateUsersWhitelist(pref_value->DeepCopy());
|
| + // Return a copy because the UI will take ownership of this object.
|
| return pref_value->DeepCopy();
|
| }
|
| // All other prefs are decorated the same way.
|
| return CreateSettingsValue(
|
| - pref_value->DeepCopy(),
|
| + pref_value->DeepCopy(), // The copy will be owned by the dictionary.
|
| g_browser_process->browser_policy_connector()->IsEnterpriseManaged(),
|
| !UserManager::Get()->current_user_is_owner());
|
| }
|
|
|