OLD | NEW |
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 #include "ui/base/webui/web_ui_util.h" | 5 #include "ui/base/webui/web_ui_util.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/base64.h" | 9 #include "base/base64.h" |
10 #include "base/i18n/rtl.h" | 10 #include "base/i18n/rtl.h" |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 placeholders.push_back(GetTextDirection()); // $1 | 123 placeholders.push_back(GetTextDirection()); // $1 |
124 placeholders.push_back(GetFontFamily()); // $2 | 124 placeholders.push_back(GetFontFamily()); // $2 |
125 placeholders.push_back(GetFontSize()); // $3 | 125 placeholders.push_back(GetFontSize()); // $3 |
126 | 126 |
127 const ui::ResourceBundle& resource_bundle = | 127 const ui::ResourceBundle& resource_bundle = |
128 ui::ResourceBundle::GetSharedInstance(); | 128 ui::ResourceBundle::GetSharedInstance(); |
129 const std::string& css_template = | 129 const std::string& css_template = |
130 resource_bundle.GetRawDataResource(IDR_WEBUI_CSS_TEXT_DEFAULTS) | 130 resource_bundle.GetRawDataResource(IDR_WEBUI_CSS_TEXT_DEFAULTS) |
131 .as_string(); | 131 .as_string(); |
132 | 132 |
133 return ReplaceStringPlaceholders(css_template, placeholders, nullptr); | 133 return base::ReplaceStringPlaceholders(css_template, placeholders, nullptr); |
134 } | 134 } |
135 | 135 |
136 void AppendWebUiCssTextDefaults(std::string* html) { | 136 void AppendWebUiCssTextDefaults(std::string* html) { |
137 html->append("<style>"); | 137 html->append("<style>"); |
138 html->append(GetWebUiCssTextDefaults()); | 138 html->append(GetWebUiCssTextDefaults()); |
139 html->append("</style>"); | 139 html->append("</style>"); |
140 } | 140 } |
141 | 141 |
142 std::string GetFontFamily() { | 142 std::string GetFontFamily() { |
143 std::string font_family = l10n_util::GetStringUTF8( | 143 std::string font_family = l10n_util::GetStringUTF8( |
(...skipping 20 matching lines...) Expand all Loading... |
164 IDS_WEB_FONT_SIZE_XP : | 164 IDS_WEB_FONT_SIZE_XP : |
165 #endif | 165 #endif |
166 IDS_WEB_FONT_SIZE); | 166 IDS_WEB_FONT_SIZE); |
167 } | 167 } |
168 | 168 |
169 std::string GetTextDirection() { | 169 std::string GetTextDirection() { |
170 return base::i18n::IsRTL() ? "rtl" : "ltr"; | 170 return base::i18n::IsRTL() ? "rtl" : "ltr"; |
171 } | 171 } |
172 | 172 |
173 } // namespace webui | 173 } // namespace webui |
OLD | NEW |