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

Unified Diff: chrome/browser/content_settings/content_settings_internal_extension_provider.h

Issue 276573011: Remove deprecated extension notification from content_settings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove observer from ShutdownOnUIThread Created 6 years, 3 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/content_settings/content_settings_internal_extension_provider.h
diff --git a/chrome/browser/content_settings/content_settings_internal_extension_provider.h b/chrome/browser/content_settings/content_settings_internal_extension_provider.h
index 2078f4eed09d2bee2a3a2f29cbe586336123c18c..ae8ba2883b395a13d4c53b171dcf8108e7d279c7 100644
--- a/chrome/browser/content_settings/content_settings_internal_extension_provider.h
+++ b/chrome/browser/content_settings/content_settings_internal_extension_provider.h
@@ -12,18 +12,21 @@
#include "components/content_settings/core/common/content_settings.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
+#include "extensions/browser/extension_registry_observer.h"
class ExtensionService;
namespace extensions {
class Extension;
+class ExtensionRegistry;
}
namespace content_settings {
// A content settings provider which disables certain plugins for platform apps.
class InternalExtensionProvider : public ObservableProvider,
- public content::NotificationObserver {
+ public content::NotificationObserver,
+ public extensions::ExtensionRegistryObserver {
public:
explicit InternalExtensionProvider(ExtensionService* extension_service);
@@ -51,6 +54,16 @@ class InternalExtensionProvider : public ObservableProvider,
virtual void Observe(int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) OVERRIDE;
+
+ // extensions::ExtensionRegistryObserver implementation.
+ virtual void OnExtensionLoaded(
+ content::BrowserContext* browser_context,
+ const extensions::Extension* extension) OVERRIDE;
+ virtual void OnExtensionUnloaded(
+ content::BrowserContext* browser_context,
+ const extensions::Extension* extension,
+ extensions::UnloadedExtensionInfo::Reason reason) OVERRIDE;
+
private:
void SetContentSettingForExtension(const extensions::Extension* extension,
ContentSetting setting);
@@ -65,6 +78,8 @@ class InternalExtensionProvider : public ObservableProvider,
mutable base::Lock lock_;
scoped_ptr<content::NotificationRegistrar> registrar_;
+ extensions::ExtensionRegistry* extension_registry_; // Not owned.
+
DISALLOW_COPY_AND_ASSIGN(InternalExtensionProvider);
};

Powered by Google App Engine
This is Rietveld 408576698