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

Unified Diff: ui/base/webui/web_ui_util.cc

Issue 1516233003: Incognito NTP style tweaks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update Roboto font with full charset version Created 4 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 | « ui/base/webui/web_ui_util.h ('k') | ui/webui/resources/css/roboto.css » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/webui/web_ui_util.cc
diff --git a/ui/base/webui/web_ui_util.cc b/ui/base/webui/web_ui_util.cc
index 7c894f698051c7431585b9be50a9363884d1ca65..d9c1d76da6643bdcc70f31b78992f6351db7f0cd 100644
--- a/ui/base/webui/web_ui_util.cc
+++ b/ui/base/webui/web_ui_util.cc
@@ -122,19 +122,30 @@ void SetLoadTimeDataDefaults(const std::string& app_locale,
localized_strings->SetString("textdirection", GetTextDirection());
}
-std::string GetWebUiCssTextDefaults() {
+std::string GetWebUiCssTextDefaults(const std::string& css_template) {
std::map<base::StringPiece, std::string> placeholders;
placeholders["textDirection"] = GetTextDirection();
placeholders["fontFamily"] = GetFontFamily();
placeholders["fontSize"] = GetFontSize();
+ return ui::ReplaceTemplateExpressions(css_template, placeholders);
+}
+std::string GetWebUiCssTextDefaults() {
const ui::ResourceBundle& resource_bundle =
ui::ResourceBundle::GetSharedInstance();
const std::string& css_template =
resource_bundle.GetRawDataResource(IDR_WEBUI_CSS_TEXT_DEFAULTS)
.as_string();
+ return GetWebUiCssTextDefaults(css_template);
+}
- return ui::ReplaceTemplateExpressions(css_template, placeholders);
+std::string GetWebUiCssTextDefaultsMd() {
+ const ui::ResourceBundle& resource_bundle =
+ ui::ResourceBundle::GetSharedInstance();
+ const std::string& css_template =
+ resource_bundle.GetRawDataResource(IDR_WEBUI_CSS_TEXT_DEFAULTS_MD)
+ .as_string();
+ return GetWebUiCssTextDefaults(css_template);
}
void AppendWebUiCssTextDefaults(std::string* html) {
« no previous file with comments | « ui/base/webui/web_ui_util.h ('k') | ui/webui/resources/css/roboto.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698