| Index: chrome/browser/ui/prefs/prefs_tab_helper.cc
|
| diff --git a/chrome/browser/ui/prefs/prefs_tab_helper.cc b/chrome/browser/ui/prefs/prefs_tab_helper.cc
|
| index 1bf7507185a7eb211e8192a8392265c4a3cfa3b1..b12a559d4cc56cd396d8a68f80c24f501ebeb57e 100644
|
| --- a/chrome/browser/ui/prefs/prefs_tab_helper.cc
|
| +++ b/chrome/browser/ui/prefs/prefs_tab_helper.cc
|
| @@ -15,6 +15,7 @@
|
| #include "chrome/browser/profiles/profile.h"
|
| #include "chrome/browser/renderer_preferences_util.h"
|
| #include "chrome/common/chrome_notification_types.h"
|
| +#include "chrome/common/font_family_scripts.h"
|
| #include "chrome/common/pref_names.h"
|
| #include "chrome/common/pref_names_util.h"
|
| #include "components/user_prefs/pref_registry_syncable.h"
|
| @@ -123,12 +124,11 @@ const int kPrefsToObserveLength = arraysize(kPrefsToObserve);
|
| // per-script font prefs. For example, if |map_name| is "fonts.serif", then
|
| // "fonts.serif.Arab", "fonts.serif.Hang", etc. are registered.
|
| void RegisterFontFamilyMap(PrefRegistrySyncable* registry,
|
| - const char* map_name,
|
| const std::set<std::string>& fonts_with_defaults) {
|
| - for (size_t i = 0; i < prefs::kWebKitScriptsForFontFamilyMapsLength; ++i) {
|
| - const char* script = prefs::kWebKitScriptsForFontFamilyMaps[i];
|
| - std::string pref_name_str = base::StringPrintf("%s.%s", map_name, script);
|
| - const char* pref_name = pref_name_str.c_str();
|
| + // kFontFamilyScripts is auto-generated at build time in order to
|
| + // have all the data in the static RO segment rather than heap allocated.
|
| + for (size_t i = 0; i < arraysize(kFontFamilyScripts); ++i) {
|
| + const char* pref_name = kFontFamilyScripts[i];
|
| if (fonts_with_defaults.find(pref_name) == fonts_with_defaults.end()) {
|
| // We haven't already set a default value for this font preference, so set
|
| // an empty string as the default.
|
| @@ -539,20 +539,7 @@ void PrefsTabHelper::RegisterUserPrefs(PrefRegistrySyncable* registry) {
|
| }
|
|
|
| // Register font prefs that don't have defaults.
|
| - RegisterFontFamilyMap(registry, prefs::kWebKitStandardFontFamilyMap,
|
| - fonts_with_defaults);
|
| - RegisterFontFamilyMap(registry, prefs::kWebKitFixedFontFamilyMap,
|
| - fonts_with_defaults);
|
| - RegisterFontFamilyMap(registry, prefs::kWebKitSerifFontFamilyMap,
|
| - fonts_with_defaults);
|
| - RegisterFontFamilyMap(registry, prefs::kWebKitSansSerifFontFamilyMap,
|
| - fonts_with_defaults);
|
| - RegisterFontFamilyMap(registry, prefs::kWebKitCursiveFontFamilyMap,
|
| - fonts_with_defaults);
|
| - RegisterFontFamilyMap(registry, prefs::kWebKitFantasyFontFamilyMap,
|
| - fonts_with_defaults);
|
| - RegisterFontFamilyMap(registry, prefs::kWebKitPictographFontFamilyMap,
|
| - fonts_with_defaults);
|
| + RegisterFontFamilyMap(registry, fonts_with_defaults);
|
|
|
| registry->RegisterLocalizedIntegerPref(prefs::kWebKitDefaultFontSize,
|
| IDS_DEFAULT_FONT_SIZE,
|
|
|