Chromium Code Reviews| Index: chrome/browser/ui/webui/settings_utils.cc |
| diff --git a/chrome/browser/ui/webui/settings_utils.cc b/chrome/browser/ui/webui/settings_utils.cc |
| index 687fe4ad4c4522b460351356d685c75ea084b81b..8efc1c2e228ba6f6c6163118c3e00f20ff965cfc 100644 |
| --- a/chrome/browser/ui/webui/settings_utils.cc |
| +++ b/chrome/browser/ui/webui/settings_utils.cc |
| @@ -8,6 +8,7 @@ |
| #include "chrome/grit/theme_resources.h" |
| #include "components/url_formatter/url_fixer.h" |
| #include "ui/base/resource/resource_bundle.h" |
| +#include "ui/gfx/font_list.h" |
| #include "url/gurl.h" |
| namespace settings_utils { |
| @@ -26,4 +27,22 @@ base::RefCountedMemory* GetFaviconResourceBytes(ui::ScaleFactor scale_factor) { |
| IDR_SETTINGS_FAVICON, scale_factor); |
| } |
| +#if !defined(OS_MACOSX) |
| +void ValidateSavedFonts(PrefService* prefs) { |
|
Lei Zhang
2017/06/09 04:22:53
Why not just make this function Mac only then? Fix
Dan Beam
2017/06/09 06:32:55
Done.
|
| + // Nothing to do on Windows, Linux, or ChromeOS. |
| +} |
| +#endif |
| + |
| +std::string ResolveFontList(const std::string& font_name_or_list) { |
| + if (!font_name_or_list.empty() && font_name_or_list[0] == ',') |
| + return gfx::FontList::FirstAvailableOrFirst(font_name_or_list); |
| + return font_name_or_list; |
| +} |
| + |
| +#if !defined(OS_WIN) |
| +std::string MaybeGetLocalizedFontName(const std::string& font_name_or_list) { |
| + return ResolveFontList(font_name_or_list); |
| +} |
| +#endif |
| + |
| } // namespace settings_utils |