Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1274)

Unified Diff: chrome/browser/ui/prefs/prefs_tab_helper.cc

Issue 27527003: Skip per-script font preferences registration and filling on Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address falken's remark. Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chrome_content_browser_client.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 db0b657a2219b0b22cd9a71937ca31a6bf632754..ee1aaac1d7911b24f62cbc8012b6e2c75ed6c7cd 100644
--- a/chrome/browser/ui/prefs/prefs_tab_helper.cc
+++ b/chrome/browser/ui/prefs/prefs_tab_helper.cc
@@ -138,12 +138,16 @@ const char* kPrefsToObserve[] = {
const int kPrefsToObserveLength = arraysize(kPrefsToObserve);
+#if !defined(OS_ANDROID)
// Registers a preference under the path |pref_name| for each script used for
// per-script font prefs.
// For example, for WEBKIT_WEBPREFS_FONTS_SERIF ("fonts.serif"):
// "fonts.serif.Arab", "fonts.serif.Hang", etc. are registered.
// |fonts_with_defaults| contains all |pref_names| already registered since they
// have a specified default value.
+// On Android there are no default values for these properties and there is no
+// way to set them (because extensions are not supported so the Font Settings
+// API cannot be used), so we can avoid registering them altogether.
void RegisterFontFamilyPrefs(user_prefs::PrefRegistrySyncable* registry,
const std::set<std::string>& fonts_with_defaults) {
@@ -177,7 +181,6 @@ ALL_FONT_SCRIPTS(WEBKIT_WEBPREFS_FONTS_STANDARD)
}
}
-#if !defined(OS_ANDROID)
// Registers |obs| to observe per-script font prefs under the path |map_name|.
// On android, there's no exposed way to change these prefs, so we can save
// ~715KB of heap and some startup cycles by avoiding observing these prefs
@@ -612,8 +615,10 @@ void PrefsTabHelper::RegisterProfilePrefs(
}
}
- // Register font prefs that don't have defaults.
+ // Register per-script font prefs that don't have defaults.
+#if !defined(OS_ANDROID)
RegisterFontFamilyPrefs(registry, fonts_with_defaults);
+#endif
registry->RegisterLocalizedIntegerPref(
prefs::kWebKitDefaultFontSize,
« no previous file with comments | « chrome/browser/chrome_content_browser_client.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698