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

Unified Diff: chrome/browser/extensions/api/font_settings/font_settings_api.h

Issue 11345008: Remove content::NotificationObserver dependency from most Prefs code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix PrefNotifierImpl 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/extensions/api/font_settings/font_settings_api.h
diff --git a/chrome/browser/extensions/api/font_settings/font_settings_api.h b/chrome/browser/extensions/api/font_settings/font_settings_api.h
index 9c73cf05e6a573b47a18a14039ecdb6e2227ccf1..60ebca286fb5c05f2ca438e6d919fa7a536e4150 100644
--- a/chrome/browser/extensions/api/font_settings/font_settings_api.h
+++ b/chrome/browser/extensions/api/font_settings/font_settings_api.h
@@ -13,6 +13,7 @@
#include <utility>
#include "base/prefs/public/pref_change_registrar.h"
+#include "base/prefs/public/pref_observer.h"
#include "chrome/browser/extensions/extension_function.h"
#include "chrome/browser/prefs/pref_service.h"
@@ -20,7 +21,7 @@ namespace extensions {
// This class observes pref changed events on a profile and dispatches the
// corresponding extension API events to extensions.
-class FontSettingsEventRouter : public content::NotificationObserver {
+class FontSettingsEventRouter : public PrefObserver {
public:
// Constructor for observing pref changed events on |profile|. Stores a
// pointer to |profile| but does not take ownership. |profile| must be
@@ -48,10 +49,9 @@ class FontSettingsEventRouter : public content::NotificationObserver {
const char* event_name,
const char* key);
- // content::NotificationObserver implementation.
- virtual void Observe(int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) OVERRIDE;
+ // PrefObserver implementation.
+ virtual void OnPreferenceChanged(PrefServiceBase* service,
+ const std::string& pref_name) OVERRIDE;
// Dispatches a changed event for the font setting for |generic_family| and
// |script| to extensions. The new value of the setting is the value of
@@ -70,7 +70,7 @@ class FontSettingsEventRouter : public content::NotificationObserver {
// under the key |key|. If the pref changed on the incognito profile,
// |incognito| must be set to true for extensions to get the appropriate
// event.
- void OnFontPrefChanged(PrefService* pref_service,
+ void OnFontPrefChanged(PrefServiceBase* pref_service,
const std::string& pref_name,
const std::string& event_name,
const std::string& key,

Powered by Google App Engine
This is Rietveld 408576698