| Index: chrome/browser/ui/webui/chromeos/login/l10n_util.cc
|
| diff --git a/chrome/browser/ui/webui/chromeos/login/l10n_util.cc b/chrome/browser/ui/webui/chromeos/login/l10n_util.cc
|
| index 41389aa027ee5175e78e0faf1a99030303a8e0f4..2e2a0ec3472110937b792d4a3ef618ebe50a473a 100644
|
| --- a/chrome/browser/ui/webui/chromeos/login/l10n_util.cc
|
| +++ b/chrome/browser/ui/webui/chromeos/login/l10n_util.cc
|
| @@ -8,6 +8,7 @@
|
|
|
| #include <iterator>
|
| #include <map>
|
| +#include <memory>
|
| #include <set>
|
| #include <utility>
|
|
|
| @@ -71,7 +72,7 @@ void AddOptgroupOtherLayouts(base::ListValue* input_methods_list) {
|
| optgroup->SetString(
|
| "optionGroupName",
|
| l10n_util::GetStringUTF16(IDS_OOBE_OTHER_KEYBOARD_LAYOUTS));
|
| - input_methods_list->Append(optgroup.release());
|
| + input_methods_list->Append(std::move(optgroup));
|
| }
|
|
|
| base::DictionaryValue* CreateLanguageEntry(
|
| @@ -267,9 +268,10 @@ std::unique_ptr<base::ListValue> GetLanguageList(
|
| base::string16 display_name(out_display_names[i]);
|
| if (insert_divider && display_name == divider16) {
|
| // Insert divider.
|
| - base::DictionaryValue* dictionary = new base::DictionaryValue();
|
| + std::unique_ptr<base::DictionaryValue> dictionary(
|
| + new base::DictionaryValue());
|
| dictionary->SetString("code", kMostRelevantLanguagesDivider);
|
| - language_list->Append(dictionary);
|
| + language_list->Append(std::move(dictionary));
|
| continue;
|
| }
|
|
|
| @@ -322,8 +324,7 @@ void GetKeyboardLayoutsForResolvedLocale(
|
| util->GetInputMethodDescriptorFromId(*it);
|
| if (!InsertString(ime->id(), &input_methods_added))
|
| continue;
|
| - input_methods_list->Append(
|
| - CreateInputMethodsEntry(*ime, selected).release());
|
| + input_methods_list->Append(CreateInputMethodsEntry(*ime, selected));
|
| }
|
|
|
| callback.Run(std::move(input_methods_list));
|
| @@ -535,8 +536,7 @@ std::unique_ptr<base::ListValue> GetAndActivateLoginKeyboardLayouts(
|
| // Do not crash in case of misconfiguration.
|
| if (ime) {
|
| input_methods_added.insert(*i);
|
| - input_methods_list->Append(
|
| - CreateInputMethodsEntry(*ime, selected).release());
|
| + input_methods_list->Append(CreateInputMethodsEntry(*ime, selected));
|
| } else {
|
| NOTREACHED();
|
| }
|
| @@ -552,8 +552,8 @@ std::unique_ptr<base::ListValue> GetAndActivateLoginKeyboardLayouts(
|
| optgroup_added = true;
|
| AddOptgroupOtherLayouts(input_methods_list.get());
|
| }
|
| - input_methods_list->Append(CreateInputMethodsEntry((*input_methods)[i],
|
| - selected).release());
|
| + input_methods_list->Append(
|
| + CreateInputMethodsEntry((*input_methods)[i], selected));
|
| }
|
|
|
| // "xkb:us::eng" should always be in the list of available layouts.
|
| @@ -567,8 +567,8 @@ std::unique_ptr<base::ListValue> GetAndActivateLoginKeyboardLayouts(
|
| optgroup_added = true;
|
| AddOptgroupOtherLayouts(input_methods_list.get());
|
| }
|
| - input_methods_list->Append(CreateInputMethodsEntry(*us_eng_descriptor,
|
| - selected).release());
|
| + input_methods_list->Append(
|
| + CreateInputMethodsEntry(*us_eng_descriptor, selected));
|
| manager->GetActiveIMEState()->EnableInputMethod(us_keyboard_id);
|
| }
|
| return input_methods_list;
|
|
|