| Index: content/browser/webui/web_ui_data_source_impl.cc
|
| diff --git a/content/browser/webui/web_ui_data_source_impl.cc b/content/browser/webui/web_ui_data_source_impl.cc
|
| index e923236b94696e343d18a0eb596a5afe995f9675..565d19dcc227b1a04bc18f2ebf454fcd7de37c11 100644
|
| --- a/content/browser/webui/web_ui_data_source_impl.cc
|
| +++ b/content/browser/webui/web_ui_data_source_impl.cc
|
| @@ -136,24 +136,13 @@ void WebUIDataSourceImpl::AddLocalizedString(const std::string& name,
|
| void WebUIDataSourceImpl::AddLocalizedStrings(
|
| const base::DictionaryValue& localized_strings) {
|
| localized_strings_.MergeDictionary(&localized_strings);
|
| -
|
| - for (base::DictionaryValue::Iterator it(localized_strings); !it.IsAtEnd();
|
| - it.Advance()) {
|
| - if (it.value().IsType(base::Value::Type::STRING)) {
|
| - std::string value;
|
| - it.value().GetAsString(&value);
|
| - replacements_[it.key()] = value;
|
| - }
|
| - }
|
| + ui::TemplateReplacementsFromDictionaryValue(localized_strings,
|
| + &replacements_);
|
| }
|
|
|
| void WebUIDataSourceImpl::AddBoolean(const std::string& name, bool value) {
|
| localized_strings_.SetBoolean(name, value);
|
| - // TODO(dschuyler): Change name of |localized_strings_| to |load_time_data_|
|
| - // or similar. These values haven't been found as strings for
|
| - // localization. The boolean values are not added to |replacements_|
|
| - // for the same reason, that they are used as flags, rather than string
|
| - // replacements.
|
| + ui::TemplateReplacementsSetBool(name, value, &replacements_);
|
| }
|
|
|
| void WebUIDataSourceImpl::AddInteger(const std::string& name, int32_t value) {
|
|
|