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

Unified Diff: chrome/browser/ui/webui/extensions/extension_settings_handler.cc

Issue 319353002: cleanup/ Use ExtensionRegistry in ExtensionSettingsHandler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 6 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/extensions/extension_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/extensions/extension_settings_handler.cc
diff --git a/chrome/browser/ui/webui/extensions/extension_settings_handler.cc b/chrome/browser/ui/webui/extensions/extension_settings_handler.cc
index ccd4e47f98af8e23159118778e13eec726d57d78..1e667a570a5567e423f8129658d05d3bed1a6091 100644
--- a/chrome/browser/ui/webui/extensions/extension_settings_handler.cc
+++ b/chrome/browser/ui/webui/extensions/extension_settings_handler.cc
@@ -165,6 +165,7 @@ ExtensionSettingsHandler::ExtensionSettingsHandler()
warning_service_observer_(this),
error_console_observer_(this),
extension_prefs_observer_(this),
+ extension_registry_observer_(this),
should_do_verification_check_(false) {
}
@@ -183,6 +184,7 @@ ExtensionSettingsHandler::ExtensionSettingsHandler(ExtensionService* service,
warning_service_observer_(this),
error_console_observer_(this),
extension_prefs_observer_(this),
+ extension_registry_observer_(this),
should_do_verification_check_(false) {
}
@@ -651,9 +653,6 @@ void ExtensionSettingsHandler::Observe(
MaybeUpdateAfterNotification();
break;
}
- case chrome::NOTIFICATION_EXTENSION_LOADED_DEPRECATED:
- case chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED:
- case chrome::NOTIFICATION_EXTENSION_UNINSTALLED_DEPRECATED:
case chrome::NOTIFICATION_EXTENSION_UPDATE_DISABLED:
case chrome::NOTIFICATION_EXTENSION_BROWSER_ACTION_VISIBILITY_CHANGED:
MaybeUpdateAfterNotification();
@@ -672,6 +671,25 @@ void ExtensionSettingsHandler::Observe(
}
}
+void ExtensionSettingsHandler::OnExtensionLoaded(
+ content::BrowserContext* browser_context,
+ const Extension* extension) {
+ MaybeUpdateAfterNotification();
+}
+
+void ExtensionSettingsHandler::OnExtensionUnloaded(
+ content::BrowserContext* browser_context,
+ const Extension* extension,
+ UnloadedExtensionInfo::Reason reason) {
+ MaybeUpdateAfterNotification();
+}
+
+void ExtensionSettingsHandler::OnExtensionUninstalled(
+ content::BrowserContext* browser_context,
+ const Extension* extension) {
+ MaybeUpdateAfterNotification();
+}
+
void ExtensionSettingsHandler::OnExtensionDisableReasonsChanged(
const std::string& extension_id, int disable_reasons) {
MaybeUpdateAfterNotification();
@@ -1136,14 +1154,6 @@ void ExtensionSettingsHandler::MaybeRegisterForNotifications() {
Profile* profile = Profile::FromWebUI(web_ui());
// Register for notifications that we need to reload the page.
- registrar_.Add(this,
- chrome::NOTIFICATION_EXTENSION_LOADED_DEPRECATED,
- content::Source<Profile>(profile));
- registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED,
- content::Source<Profile>(profile));
- registrar_.Add(this,
- chrome::NOTIFICATION_EXTENSION_UNINSTALLED_DEPRECATED,
- content::Source<Profile>(profile));
registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UPDATE_DISABLED,
content::Source<Profile>(profile));
registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_HOST_CREATED,
@@ -1161,11 +1171,12 @@ void ExtensionSettingsHandler::MaybeRegisterForNotifications() {
registrar_.Add(this,
chrome::NOTIFICATION_EXTENSION_HOST_DESTROYED,
content::NotificationService::AllBrowserContextsAndSources());
-
registrar_.Add(this,
content::NOTIFICATION_RENDER_WIDGET_HOST_DESTROYED,
content::NotificationService::AllBrowserContextsAndSources());
+ extension_registry_observer_.Add(ExtensionRegistry::Get(profile));
+
content::WebContentsObserver::Observe(web_ui()->GetWebContents());
warning_service_observer_.Add(
« no previous file with comments | « chrome/browser/ui/webui/extensions/extension_settings_handler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698