| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/ui/webui/options/font_settings_utils.h" | 5 #include "chrome/browser/ui/webui/options/font_settings_utils.h" |
| 6 | 6 |
| 7 #include "ui/gfx/font.h" |
| 8 #include "ui/gfx/platform_font_win.h" |
| 9 |
| 7 namespace options { | 10 namespace options { |
| 8 | 11 |
| 9 // static | 12 // static |
| 10 void FontSettingsUtilities::ValidateSavedFonts(PrefService* prefs) { | 13 void FontSettingsUtilities::ValidateSavedFonts(PrefService* prefs) { |
| 11 // Nothing to do for Windows. | 14 // Nothing to do for Windows. |
| 12 } | 15 } |
| 13 | 16 |
| 17 std::string FontSettingsUtilities::MaybeGetLocalizedFontName( |
| 18 const std::string& font_name_or_list) { |
| 19 std::string font_name = ResolveFontList(font_name_or_list); |
| 20 if (font_name.empty()) |
| 21 return font_name; |
| 22 gfx::Font font(font_name, 12); // dummy font size |
| 23 return static_cast<gfx::PlatformFontWin*>(font.platform_font()) |
| 24 ->GetLocalizedFontName(); |
| 25 } |
| 26 |
| 14 } // namespace options | 27 } // namespace options |
| OLD | NEW |