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

Unified Diff: chrome/browser/extensions/extension_infobar_delegate.h

Issue 259843004: Remove some NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED from c/b/extensions Part2 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address review comment Created 6 years, 8 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/extension_infobar_delegate.h
diff --git a/chrome/browser/extensions/extension_infobar_delegate.h b/chrome/browser/extensions/extension_infobar_delegate.h
index 81f92b80b324671ec0244903b468befe4be55b0e..ec699d9c2a08fb59525984d0657e469890f77ce1 100644
--- a/chrome/browser/extensions/extension_infobar_delegate.h
+++ b/chrome/browser/extensions/extension_infobar_delegate.h
@@ -6,9 +6,11 @@
#define CHROME_BROWSER_EXTENSIONS_EXTENSION_INFOBAR_DELEGATE_H_
#include "base/memory/scoped_ptr.h"
+#include "base/scoped_observer.h"
#include "chrome/browser/infobars/confirm_infobar_delegate.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
+#include "extensions/browser/extension_registry_observer.h"
class Browser;
class GURL;
@@ -19,13 +21,15 @@ class WebContents;
namespace extensions {
class Extension;
+class ExtensionRegistry;
class ExtensionViewHost;
}
// The InfobarDelegate for creating and managing state for the ExtensionInfobar
// plus monitor when the extension goes away.
class ExtensionInfoBarDelegate : public infobars::InfoBarDelegate,
- public content::NotificationObserver {
+ public content::NotificationObserver,
+ public extensions::ExtensionRegistryObserver {
public:
virtual ~ExtensionInfoBarDelegate();
@@ -59,18 +63,24 @@ class ExtensionInfoBarDelegate : public infobars::InfoBarDelegate,
static scoped_ptr<infobars::InfoBar> CreateInfoBar(
scoped_ptr<ExtensionInfoBarDelegate> delegate);
- // InfoBarDelegate:
+ // InfoBarDelegate.
virtual bool EqualsDelegate(
infobars::InfoBarDelegate* delegate) const OVERRIDE;
virtual void InfoBarDismissed() OVERRIDE;
virtual Type GetInfoBarType() const OVERRIDE;
virtual ExtensionInfoBarDelegate* AsExtensionInfoBarDelegate() OVERRIDE;
- // content::NotificationObserver:
+ // content::NotificationObserver.
virtual void Observe(int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) OVERRIDE;
+ // extensions::ExtensionRegistryObserver.
+ virtual void OnExtensionUnloaded(
+ content::BrowserContext* browser_context,
+ const extensions::Extension* extension,
+ extensions::UnloadedExtensionInfo::Reason reason) OVERRIDE;
+
#if defined(TOOLKIT_VIEWS)
Browser* browser_; // We pass this to the ExtensionInfoBar.
#endif
@@ -82,6 +92,10 @@ class ExtensionInfoBarDelegate : public infobars::InfoBarDelegate,
const extensions::Extension* extension_;
content::NotificationRegistrar registrar_;
+ ScopedObserver<extensions::ExtensionRegistry,
+ extensions::ExtensionRegistryObserver>
+ extension_registry_observer_;
+
// The requested height of the infobar (in pixels).
int height_;

Powered by Google App Engine
This is Rietveld 408576698