Commit 3c4b196b authored by Alexander Dunaev's avatar Alexander Dunaev Committed by Commit Bot

[ozone] Enabled requesting the font name.

webui::GetFontFamily() had a Linux-specific piece of logic that was
disabled for Ozone because use of pangocairo was not enabled for Ozone.
However, since [1] pangocairo is enabled for desktop Linux Ozone
platforms.

This CL removes the check for Ozone in webui::GetFontFamily().

[1] https://chromium-review.googlesource.com/c/chromium/src/+/2366901

Bug: 320050
Change-Id: I2fe8a9cc12db183e5299f953f720c4241cb43cb7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2505752
Commit-Queue: Alexander Dunaev <adunaev@igalia.com>
Reviewed-by: default avatardpapad <dpapad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#823894}
parent a1f44232
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
#include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h" #include "ui/base/resource/resource_bundle.h"
#include "ui/base/template_expressions.h" #include "ui/base/template_expressions.h"
#include "ui/base/ui_base_features.h"
#include "ui/base/window_open_disposition.h" #include "ui/base/window_open_disposition.h"
#include "ui/gfx/codec/png_codec.h" #include "ui/gfx/codec/png_codec.h"
#include "ui/gfx/font.h" #include "ui/gfx/font.h"
...@@ -34,10 +33,6 @@ ...@@ -34,10 +33,6 @@
#include "base/win/windows_version.h" #include "base/win/windows_version.h"
#endif #endif
#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
#include "ui/base/ui_base_features.h"
#endif
namespace webui { namespace webui {
namespace { namespace {
std::string GetWebUiCssTextDefaults(const std::string& css_template) { std::string GetWebUiCssTextDefaults(const std::string& css_template) {
...@@ -226,17 +221,13 @@ void AppendWebUiCssTextDefaults(std::string* html) { ...@@ -226,17 +221,13 @@ void AppendWebUiCssTextDefaults(std::string* html) {
std::string GetFontFamily() { std::string GetFontFamily() {
std::string font_family = l10n_util::GetStringUTF8(IDS_WEB_FONT_FAMILY); std::string font_family = l10n_util::GetStringUTF8(IDS_WEB_FONT_FAMILY);
// TODO(dnicoara) Remove Ozone check when PlatformFont support is introduced
// into Ozone: crbug.com/320050
#if defined(OS_LINUX) && !defined(OS_CHROMEOS) #if defined(OS_LINUX) && !defined(OS_CHROMEOS)
if (!features::IsUsingOzonePlatform()) { std::string font_name = ui::ResourceBundle::GetSharedInstance()
std::string font_name = ui::ResourceBundle::GetSharedInstance() .GetFont(ui::ResourceBundle::BaseFont)
.GetFont(ui::ResourceBundle::BaseFont) .GetFontName();
.GetFontName(); // Wrap |font_name| with quotes to ensure it will always be parsed correctly
// Wrap |font_name| with quotes to ensure it will always be parsed correctly // in CSS.
// in CSS. font_family = "\"" + font_name + "\", " + font_family;
font_family = "\"" + font_name + "\", " + font_family;
}
#endif #endif
return font_family; return font_family;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment