Chromium Code Reviews| Index: chrome/browser/chrome_content_browser_client.cc |
| diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc |
| index 87b4810c84496bca98e654eca78011517dbd2d77..58b43f152be3286d0fe08f95d8f9afa5a65b5ca7 100644 |
| --- a/chrome/browser/chrome_content_browser_client.cc |
| +++ b/chrome/browser/chrome_content_browser_client.cc |
| @@ -39,6 +39,7 @@ |
| #include "chrome/browser/extensions/extension_web_ui.h" |
| #include "chrome/browser/extensions/extension_webkit_preferences.h" |
| #include "chrome/browser/extensions/suggest_permission_util.h" |
| +#include "chrome/browser/font_family_cache.h" |
| #include "chrome/browser/geolocation/chrome_access_token_store.h" |
| #include "chrome/browser/geolocation/geolocation_permission_context.h" |
| #include "chrome/browser/geolocation/geolocation_permission_context_factory.h" |
| @@ -501,23 +502,7 @@ bool CertMatchesFilter(const net::X509Certificate& cert, |
| return false; |
| } |
| -#if !defined(OS_ANDROID) |
| -// Fills |map| with the per-script font prefs under path |map_name|. |
| -void FillFontFamilyMap(const PrefService* prefs, |
| - const char* map_name, |
| - content::ScriptFontFamilyMap* map) { |
| - // TODO(falken): Get rid of the brute-force scan over possible |
| - // (font family / script) combinations - see http://crbug.com/308095. |
| - for (size_t i = 0; i < prefs::kWebKitScriptsForFontFamilyMapsLength; ++i) { |
| - const char* script = prefs::kWebKitScriptsForFontFamilyMaps[i]; |
| - std::string pref_name = base::StringPrintf("%s.%s", map_name, script); |
| - std::string font_family = prefs->GetString(pref_name.c_str()); |
| - if (!font_family.empty()) |
| - (*map)[script] = base::UTF8ToUTF16(font_family); |
| - } |
| -} |
| - |
| -#if defined(OS_POSIX) && !defined(OS_MACOSX) |
| +#if !defined(OS_ANDROID) && defined(OS_POSIX) && !defined(OS_MACOSX) |
|
Lei Zhang
2014/08/05 21:15:08
nit: #if defined(OS_POSIX) && !defined(OS_MACOSX)
erikchen
2014/08/05 21:34:17
Is the goal to get all the positive conditionals b
Lei Zhang
2014/08/05 21:48:55
Yes, it's more readable.
|
| breakpad::CrashHandlerHostLinux* CreateCrashHandlerHost( |
| const std::string& process_type) { |
| base::FilePath dumps_path; |
| @@ -574,8 +559,7 @@ int GetCrashSignalFD(const CommandLine& command_line) { |
| return -1; |
| } |
| -#endif // defined(OS_POSIX) && !defined(OS_MACOSX) |
| -#endif // !defined(OS_ANDROID) |
| +#endif // !defined(OS_ANDROID) && defined(OS_POSIX) && !defined(OS_MACOSX) |
| #if !defined(OS_CHROMEOS) |
| GURL GetEffectiveURLForSignin(const GURL& url) { |
| @@ -2423,20 +2407,27 @@ void ChromeContentBrowserClient::OverrideWebkitPrefs( |
| // Fill per-script font preferences. These are not registered on Android |
| // - http://crbug.com/308033. |
| #if !defined(OS_ANDROID) |
| - FillFontFamilyMap(prefs, prefs::kWebKitStandardFontFamilyMap, |
| - &web_prefs->standard_font_family_map); |
| - FillFontFamilyMap(prefs, prefs::kWebKitFixedFontFamilyMap, |
| - &web_prefs->fixed_font_family_map); |
| - FillFontFamilyMap(prefs, prefs::kWebKitSerifFontFamilyMap, |
| - &web_prefs->serif_font_family_map); |
| - FillFontFamilyMap(prefs, prefs::kWebKitSansSerifFontFamilyMap, |
| - &web_prefs->sans_serif_font_family_map); |
| - FillFontFamilyMap(prefs, prefs::kWebKitCursiveFontFamilyMap, |
| - &web_prefs->cursive_font_family_map); |
| - FillFontFamilyMap(prefs, prefs::kWebKitFantasyFontFamilyMap, |
| - &web_prefs->fantasy_font_family_map); |
| - FillFontFamilyMap(prefs, prefs::kWebKitPictographFontFamilyMap, |
| - &web_prefs->pictograph_font_family_map); |
| + FontFamilyCache::FillFontFamilyMap(profile, |
| + prefs::kWebKitStandardFontFamilyMap, |
| + &web_prefs->standard_font_family_map); |
| + FontFamilyCache::FillFontFamilyMap(profile, |
| + prefs::kWebKitFixedFontFamilyMap, |
| + &web_prefs->fixed_font_family_map); |
| + FontFamilyCache::FillFontFamilyMap(profile, |
| + prefs::kWebKitSerifFontFamilyMap, |
| + &web_prefs->serif_font_family_map); |
| + FontFamilyCache::FillFontFamilyMap(profile, |
| + prefs::kWebKitSansSerifFontFamilyMap, |
| + &web_prefs->sans_serif_font_family_map); |
| + FontFamilyCache::FillFontFamilyMap(profile, |
| + prefs::kWebKitCursiveFontFamilyMap, |
| + &web_prefs->cursive_font_family_map); |
| + FontFamilyCache::FillFontFamilyMap(profile, |
| + prefs::kWebKitFantasyFontFamilyMap, |
| + &web_prefs->fantasy_font_family_map); |
| + FontFamilyCache::FillFontFamilyMap(profile, |
| + prefs::kWebKitPictographFontFamilyMap, |
| + &web_prefs->pictograph_font_family_map); |
| #endif |
| web_prefs->default_font_size = |