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

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: nits Created 3 years, 11 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
« no previous file with comments | « chrome/browser/ui/webui/options/options_ui.cc ('k') | ui/base/template_expressions.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 a5751c48b657911be3f0694b0974dd12ebeade55..ea209cf90fe6ac8f90badfb21b60b444a863871e 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) {
« no previous file with comments | « chrome/browser/ui/webui/options/options_ui.cc ('k') | ui/base/template_expressions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698