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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_BASE_WEBUI_WEB_UI_UTIL_H_ 5 #ifndef UI_BASE_WEBUI_WEB_UI_UTIL_H_
6 #define UI_BASE_WEBUI_WEB_UI_UTIL_H_ 6 #define UI_BASE_WEBUI_WEB_UI_UTIL_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/strings/string_piece.h" 10 #include "base/strings/string_piece.h"
(...skipping 27 matching lines...) Expand all
38 // Pares a formatted scale factor string into float and sets to |scale_factor|. 38 // Pares a formatted scale factor string into float and sets to |scale_factor|.
39 UI_BASE_EXPORT bool ParseScaleFactor(const base::StringPiece& identifier, 39 UI_BASE_EXPORT bool ParseScaleFactor(const base::StringPiece& identifier,
40 float* scale_factor); 40 float* scale_factor);
41 41
42 // Parses a URL containing some path @{scale}x. If it does not contain a scale 42 // Parses a URL containing some path @{scale}x. If it does not contain a scale
43 // factor then the default scale factor is returned. 43 // factor then the default scale factor is returned.
44 UI_BASE_EXPORT void ParsePathAndScale(const GURL& url, 44 UI_BASE_EXPORT void ParsePathAndScale(const GURL& url,
45 std::string* path, 45 std::string* path,
46 float* scale_factor); 46 float* scale_factor);
47 47
48 // Helper function to set the font family, size, and text direction into the 48 // Helper function to set the text direction on the given dictionary.
49 // given dictionary. 49 // Note that while this method will also set attributes for default font size
50 UI_BASE_EXPORT void SetFontAndTextDirection( 50 // and family, using those in JS templates is deprecated, because it might lead
51 base::DictionaryValue* localized_strings); 51 // to flicker. Instead, use AppendWebUiCssTextDefaults() below.
52 // TODO(bauerb): Remove uses of font-family and font-size in JS templates.
53 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!
54
55 // Get a CSS declaration for common text styles for all of Web UI.
56 UI_BASE_EXPORT std::string GetWebUiCssTextDefaults();
57
58 // Appends the CSS declaration returned by GetWebUiCssTextDefaults() as an
59 // inline stylesheet.
60 UI_BASE_EXPORT void AppendWebUiCssTextDefaults(std::string* html);
52 61
53 // Get some common font styles for all of WebUI. 62 // Get some common font styles for all of WebUI.
54 UI_BASE_EXPORT std::string GetFontFamily(); 63 UI_BASE_EXPORT std::string GetFontFamily();
55 UI_BASE_EXPORT std::string GetFontSize(); 64 UI_BASE_EXPORT std::string GetFontSize();
56 UI_BASE_EXPORT std::string GetTextDirection(); 65 UI_BASE_EXPORT std::string GetTextDirection();
57 66
58 } // namespace webui 67 } // namespace webui
59 68
60 #endif // UI_BASE_WEBUI_WEB_UI_UTIL_H_ 69 #endif // UI_BASE_WEBUI_WEB_UI_UTIL_H_
OLDNEW
« 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