Chromium Code Reviews| Index: chrome/browser/ui/webui/options/font_settings_utils_win.cc |
| diff --git a/chrome/browser/ui/webui/options/font_settings_utils_win.cc b/chrome/browser/ui/webui/options/font_settings_utils_win.cc |
| index c96c27f968daa1acb61d71413a819cf9e252f286..0381f6fc4af43f4292ed843e769461e11071db63 100644 |
| --- a/chrome/browser/ui/webui/options/font_settings_utils_win.cc |
| +++ b/chrome/browser/ui/webui/options/font_settings_utils_win.cc |
| @@ -4,6 +4,9 @@ |
| #include "chrome/browser/ui/webui/options/font_settings_utils.h" |
| +#include "ui/gfx/font.h" |
| +#include "ui/gfx/platform_font_win.h" |
| + |
| namespace options { |
| // static |
| @@ -11,4 +14,17 @@ void FontSettingsUtilities::ValidateSavedFonts(PrefService* prefs) { |
| // Nothing to do for Windows. |
| } |
| +// Returns the localized name of a font so that settings can find it within the |
|
msw
2016/10/26 20:33:49
Ditto, this comment belongs in the header or in th
|
| +// list of system fonts. On Windows, the list of system fonts has names only |
| +// for the system locale, but the pref value may be in the English name. |
| +std::string FontSettingsUtilities::MaybeGetLocalizedFontName( |
| + const std::string& font_name_or_list) { |
| + std::string font_name = ResolveFontList(font_name_or_list); |
| + if (font_name.empty()) |
| + return font_name; |
| + gfx::Font font(font_name, 12); // dummy font size |
| + return static_cast<gfx::PlatformFontWin*>(font.platform_font()) |
| + ->GetLocalizedFontName(); |
| +} |
| + |
| } // namespace options |