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

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

Issue 12529014: Android: disables observing changes for font prefs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Adds comments Created 7 years, 9 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 | « no previous file | 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 1bf7507185a7eb211e8192a8392265c4a3cfa3b1..2e3c8ab1239342f9acbc7b5c4268ab51fe1c740a 100644
--- a/chrome/browser/ui/prefs/prefs_tab_helper.cc
+++ b/chrome/browser/ui/prefs/prefs_tab_helper.cc
@@ -138,7 +138,11 @@ void RegisterFontFamilyMap(PrefRegistrySyncable* registry,
}
}
+#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
+// since they will never change.
void RegisterFontFamilyMapObserver(
PrefChangeRegistrar* registrar,
const char* map_name,
@@ -150,6 +154,7 @@ void RegisterFontFamilyMapObserver(
registrar->Add(pref_name.c_str(), obs);
}
}
+#endif // !defined(OS_ANDROID)
struct FontDefault {
const char* pref_name;
@@ -387,6 +392,7 @@ PrefsTabHelper::PrefsTabHelper(WebContents* contents)
pref_change_registrar_.Add(pref_name, webkit_callback);
}
+#if !defined(OS_ANDROID)
RegisterFontFamilyMapObserver(&pref_change_registrar_,
prefs::kWebKitStandardFontFamilyMap,
webkit_callback);
@@ -408,6 +414,7 @@ PrefsTabHelper::PrefsTabHelper(WebContents* contents)
RegisterFontFamilyMapObserver(&pref_change_registrar_,
prefs::kWebKitPictographFontFamilyMap,
webkit_callback);
+#endif // !defined(OS_ANDROID)
}
renderer_preferences_util::UpdateFromSystemSettings(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698