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

Unified Diff: content/browser/webui/web_ui_data_source_impl.cc

Issue 2607843002: [MD settings] i18n template replacements in shared HTML resources (Closed)
Patch Set: removed TemplateReplacementsSetBool Created 3 years, 12 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: 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..af973c4b8f4102136fd25b3a02d2b1c0f029908a 100644
--- a/content/browser/webui/web_ui_data_source_impl.cc
+++ b/content/browser/webui/web_ui_data_source_impl.cc
@@ -136,15 +136,8 @@ 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) {

Powered by Google App Engine
This is Rietveld 408576698