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

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

Issue 830743003: Directly inline shared WebUI CSS declarations into the security and supervised user interstitials. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: review Created 5 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/webui/web_ui_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/webui/web_ui_util.h
diff --git a/ui/base/webui/web_ui_util.h b/ui/base/webui/web_ui_util.h
index 84e06f3170be5d3e336a932458efc5d5447f4f25..5db9f33c10cfbcd0987bab245b77b56b88e82add 100644
--- a/ui/base/webui/web_ui_util.h
+++ b/ui/base/webui/web_ui_util.h
@@ -45,10 +45,19 @@ UI_BASE_EXPORT void ParsePathAndScale(const GURL& url,
std::string* path,
float* scale_factor);
-// Helper function to set the font family, size, and text direction into the
-// given dictionary.
-UI_BASE_EXPORT void SetFontAndTextDirection(
- base::DictionaryValue* localized_strings);
+// Helper function to set the text direction on the given dictionary.
+// Note that while this method will also set attributes for default font size
+// and family, using those in JS templates is deprecated, because it might lead
+// to flicker. Instead, use AppendWebUiCssTextDefaults() below.
+// TODO(bauerb): Remove uses of font-family and font-size in JS templates.
+UI_BASE_EXPORT void SetTextDirection(base::DictionaryValue* localized_strings);
Dan Beam 2015/01/22 17:08:41 nit: rename this when it only sets text direction
Bernhard Bauer 2015/01/22 17:36:17 Hm, I did that on purpose now instead of later, so
Dan Beam 2015/01/22 17:47:58 i can see both points of view here, but i've alway
Bernhard Bauer 2015/01/23 11:57:49 Fair enough. Done!
+
+// Get a CSS declaration for common text styles for all of Web UI.
+UI_BASE_EXPORT std::string GetWebUiCssTextDefaults();
+
+// Appends the CSS declaration returned by GetWebUiCssTextDefaults() as an
+// inline stylesheet.
+UI_BASE_EXPORT void AppendWebUiCssTextDefaults(std::string* html);
// Get some common font styles for all of WebUI.
UI_BASE_EXPORT std::string GetFontFamily();
« no previous file with comments | « content/browser/webui/web_ui_data_source_impl.cc ('k') | ui/base/webui/web_ui_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698