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

Side by Side Diff: ui/base/webui/web_ui_util.cc

Issue 1227413007: Move ReplaceStringPlaceholders to base namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@join
Patch Set: Created 5 years, 5 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 | « ui/base/l10n/l10n_util.cc ('k') | no next file » | 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 #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
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
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
OLDNEW
« no previous file with comments | « ui/base/l10n/l10n_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698