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 3c66530e55e8a2e6ca7ae052f7e8491b39bfd355..f53d6bc8530076e0554f102f636821d0e0f01954 100644 |
--- a/chrome/browser/ui/webui/options/font_settings_handler.cc |
+++ b/chrome/browser/ui/webui/options/font_settings_handler.cc |
@@ -17,7 +17,6 @@ |
#include "base/values.h" |
#include "chrome/browser/browser_process.h" |
#include "chrome/browser/character_encoding.h" |
-#include "chrome/browser/chrome_notification_types.h" |
#include "chrome/browser/extensions/extension_service.h" |
#include "chrome/browser/extensions/extension_tab_util.h" |
#include "chrome/browser/profiles/profile.h" |
@@ -29,6 +28,7 @@ |
#include "content/public/browser/notification_details.h" |
#include "content/public/browser/notification_service.h" |
#include "content/public/browser/web_ui.h" |
+#include "extensions/browser/extension_registry.h" |
#include "extensions/browser/extension_system.h" |
#include "extensions/common/extension.h" |
#include "grit/chromium_strings.h" |
@@ -64,7 +64,8 @@ const char kAdvancedFontSettingsExtensionId[] = |
namespace options { |
-FontSettingsHandler::FontSettingsHandler() { |
+FontSettingsHandler::FontSettingsHandler() |
+ : extension_registry_observer_(this) { |
} |
FontSettingsHandler::~FontSettingsHandler() { |
@@ -113,11 +114,8 @@ void FontSettingsHandler::GetLocalizedValues( |
} |
void FontSettingsHandler::InitializeHandler() { |
- registrar_.Add(this, |
- chrome::NOTIFICATION_EXTENSION_LOADED_DEPRECATED, |
- content::NotificationService::AllSources()); |
- registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED, |
- content::NotificationService::AllSources()); |
+ Profile* profile = Profile::FromWebUI(web_ui()); |
+ extension_registry_observer_.Add(extensions::ExtensionRegistry::Get(profile)); |
} |
void FontSettingsHandler::InitializePage() { |
@@ -177,11 +175,16 @@ void FontSettingsHandler::RegisterMessages() { |
base::Unretained(this))); |
} |
-void FontSettingsHandler::Observe(int type, |
- const content::NotificationSource& source, |
- const content::NotificationDetails& details) { |
- DCHECK(type == chrome::NOTIFICATION_EXTENSION_LOADED_DEPRECATED || |
- type == chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED); |
+void FontSettingsHandler::OnExtensionLoaded( |
+ content::BrowserContext* browser_context, |
+ const extensions::Extension* extension) { |
+ NotifyAdvancedFontSettingsAvailability(); |
+} |
+ |
+void FontSettingsHandler::OnExtensionUnloaded( |
+ content::BrowserContext* browser_context, |
+ const extensions::Extension* extension, |
+ extensions::UnloadedExtensionInfo::Reason reason) { |
NotifyAdvancedFontSettingsAvailability(); |
} |