| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS_FONT_SETTINGS_UTILS_H_ | |
| 6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_FONT_SETTINGS_UTILS_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "base/macros.h" | |
| 11 | |
| 12 class PrefService; | |
| 13 | |
| 14 namespace options { | |
| 15 | |
| 16 // Chrome advanced options utility methods. | |
| 17 class FontSettingsUtilities { | |
| 18 public: | |
| 19 static void ValidateSavedFonts(PrefService* prefs); | |
| 20 | |
| 21 // When |font_name_or_list| starts with ",", it is a list of font names | |
| 22 // separated by "," and this function returns the first available font name. | |
| 23 // Otherwise returns |font_name_or_list| as is. | |
| 24 // Unlike gfx::FontList, this function picks one font, and character-level | |
| 25 // fallback is handled in CSS. | |
| 26 static std::string ResolveFontList(const std::string& font_name_or_list); | |
| 27 | |
| 28 // Returns the localized name of a font so that settings can find it within | |
| 29 // the list of system fonts. On Windows, the list of system fonts has names | |
| 30 // only for the system locale, but the pref value may be in the English name. | |
| 31 // For example, "MS Gothic" becomes "MS ゴシック" on localized Windows. | |
| 32 static std::string MaybeGetLocalizedFontName( | |
| 33 const std::string& font_name_or_list); | |
| 34 | |
| 35 private: | |
| 36 DISALLOW_IMPLICIT_CONSTRUCTORS(FontSettingsUtilities); | |
| 37 }; | |
| 38 | |
| 39 } // namespace options | |
| 40 | |
| 41 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_FONT_SETTINGS_UTILS_H_ | |
| OLD | NEW |