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

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

Issue 399603002: Replace usage of NOTIFICATION_EXTENSION_UNLOADED with ExtensionRegistryObserver. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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/ui/webui/options/font_settings_handler.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
}
« no previous file with comments | « chrome/browser/ui/webui/options/font_settings_handler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698