refactor: replace base::StringPrintf() calls with absl::StrFormat() (#46024)
The former is now a pass-through for the latter and is slated for removal
Xref: https://issues.chromium.org/issues/40241565
4907781
This commit is contained in:
parent
3271b82094
commit
30d2fadb28
3 changed files with 17 additions and 18 deletions
|
@ -22,6 +22,7 @@
|
|||
#include "content/public/browser/web_contents.h"
|
||||
#include "content/public/browser/web_ui.h"
|
||||
#include "net/base/url_util.h"
|
||||
#include "third_party/abseil-cpp/absl/strings/str_format.h"
|
||||
#include "ui/base/webui/web_ui_util.h"
|
||||
#include "ui/color/color_provider.h"
|
||||
#include "ui/color/color_provider_utils.h"
|
||||
|
@ -157,17 +158,16 @@ void ThemeDataSource::SendColorsCss(
|
|||
for (ui::ColorId id = start; id < end; ++id) {
|
||||
const SkColor color = color_provider.GetColor(id);
|
||||
std::string css_id_to_color_mapping =
|
||||
base::StringPrintf("%s:%s;", color_css_name.Run(id).c_str(),
|
||||
ui::ConvertSkColorToCSSColor(color).c_str());
|
||||
absl::StrFormat("%s:%s;", color_css_name.Run(id),
|
||||
ui::ConvertSkColorToCSSColor(color));
|
||||
base::StrAppend(&css_string, {css_id_to_color_mapping});
|
||||
if (generate_rgb_vars) {
|
||||
// Also generate a r,g,b string for each color so apps can construct
|
||||
// colors with their own opacities in css.
|
||||
const std::string css_rgb_color_str =
|
||||
color_utils::SkColorToRgbString(color);
|
||||
const std::string css_id_to_rgb_color_mapping =
|
||||
base::StringPrintf("%s-rgb:%s;", color_css_name.Run(id).c_str(),
|
||||
css_rgb_color_str.c_str());
|
||||
const std::string css_id_to_rgb_color_mapping = absl::StrFormat(
|
||||
"%s-rgb:%s;", color_css_name.Run(id), css_rgb_color_str);
|
||||
base::StrAppend(&css_string, {css_id_to_rgb_color_mapping});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue