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

Unified Diff: chrome/browser/ui/webui/options/font_settings_handler.cc

Issue 11345008: Remove content::NotificationObserver dependency from most Prefs code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge LKGR. Created 8 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
Index: chrome/browser/ui/webui/options/font_settings_handler.cc
diff --git a/chrome/browser/ui/webui/options/font_settings_handler.cc b/chrome/browser/ui/webui/options/font_settings_handler.cc
index ce58d3922c0fc9184637d7e02211f1fc4009d7c2..22f200e989fa7eceaaac0c9628fe510f6d87d824 100644
--- a/chrome/browser/ui/webui/options/font_settings_handler.cc
+++ b/chrome/browser/ui/webui/options/font_settings_handler.cc
@@ -187,27 +187,23 @@ void FontSettingsHandler::FontsListHasLoaded(
selected_values);
}
-void FontSettingsHandler::Observe(int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) {
- if (type == chrome::NOTIFICATION_PREF_CHANGED) {
- std::string* pref_name = content::Details<std::string>(details).ptr();
- if (*pref_name == prefs::kWebKitStandardFontFamily) {
- SetUpStandardFontSample();
- } else if (*pref_name == prefs::kWebKitSerifFontFamily) {
- SetUpSerifFontSample();
- } else if (*pref_name == prefs::kWebKitSansSerifFontFamily) {
- SetUpSansSerifFontSample();
- } else if (*pref_name == prefs::kWebKitFixedFontFamily ||
- *pref_name == prefs::kWebKitDefaultFixedFontSize) {
- SetUpFixedFontSample();
- } else if (*pref_name == prefs::kWebKitDefaultFontSize) {
- SetUpStandardFontSample();
- SetUpSerifFontSample();
- SetUpSansSerifFontSample();
- } else if (*pref_name == prefs::kWebKitMinimumFontSize) {
- SetUpMinimumFontSample();
- }
+void FontSettingsHandler::OnPreferenceChanged(PrefServiceBase* service,
+ const std::string& pref_name) {
+ if (pref_name == prefs::kWebKitStandardFontFamily) {
+ SetUpStandardFontSample();
+ } else if (pref_name == prefs::kWebKitSerifFontFamily) {
+ SetUpSerifFontSample();
+ } else if (pref_name == prefs::kWebKitSansSerifFontFamily) {
+ SetUpSansSerifFontSample();
+ } else if (pref_name == prefs::kWebKitFixedFontFamily ||
+ pref_name == prefs::kWebKitDefaultFixedFontSize) {
+ SetUpFixedFontSample();
+ } else if (pref_name == prefs::kWebKitDefaultFontSize) {
+ SetUpStandardFontSample();
+ SetUpSerifFontSample();
+ SetUpSansSerifFontSample();
+ } else if (pref_name == prefs::kWebKitMinimumFontSize) {
+ SetUpMinimumFontSample();
}
}

Powered by Google App Engine
This is Rietveld 408576698