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

Unified Diff: ui/base/template_expressions.h

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 | « content/browser/webui/web_ui_data_source_impl.cc ('k') | ui/base/template_expressions.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/template_expressions.h
diff --git a/ui/base/template_expressions.h b/ui/base/template_expressions.h
index 2531d96af20cea2a88c907d579e19e88c6263556..ae52aa661be1e590af2e5b974fc03778b90a0e7d 100644
--- a/ui/base/template_expressions.h
+++ b/ui/base/template_expressions.h
@@ -14,11 +14,22 @@
#include "base/strings/string_piece.h"
#include "ui/base/ui_base_export.h"
+namespace base {
+class DictionaryValue;
+}
+
namespace ui {
// Map of strings for template replacement in |ReplaceTemplateExpressions|.
typedef std::map<const std::string, std::string> TemplateReplacements;
+// Convert a dictionary to a replacement map. This helper function is to assist
+// migration to using TemplateReplacements directly (which is preferred).
+// TODO(dschuyler): remove this function by using TemplateReplacements directly.
+UI_BASE_EXPORT void TemplateReplacementsFromDictionaryValue(
+ const base::DictionaryValue& dictionary,
+ TemplateReplacements* replacements);
+
// Replace $i18n*{foo} in the format string with the value for the foo key in
// |subst|. If the key is not found in the |substitutions| that item will
// be unaltered.
« no previous file with comments | « content/browser/webui/web_ui_data_source_impl.cc ('k') | ui/base/template_expressions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698