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

Unified Diff: chrome/browser/ui/extensions/extension_installed_bubble.h

Issue 251603004: Remove NOTIFICATION_EXTENSION_LOADED_DEPRECATED from c/b/ui/extensions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address review Created 6 years, 7 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/ui/extensions/extension_installed_bubble.h
diff --git a/chrome/browser/ui/extensions/extension_installed_bubble.h b/chrome/browser/ui/extensions/extension_installed_bubble.h
index 0ead95b108a35d4a74fb36f2d5a2f034c7486578..fcf4b974df7ee52e387fe7c1c8444a371f3d646d 100644
--- a/chrome/browser/ui/extensions/extension_installed_bubble.h
+++ b/chrome/browser/ui/extensions/extension_installed_bubble.h
@@ -6,14 +6,17 @@
#define CHROME_BROWSER_UI_EXTENSIONS_EXTENSION_INSTALLED_BUBBLE_H_
#include "base/memory/weak_ptr.h"
+#include "base/scoped_observer.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
+#include "extensions/browser/extension_registry_observer.h"
#include "third_party/skia/include/core/SkBitmap.h"
class Browser;
namespace extensions {
class Extension;
+class ExtensionRegistry;
}
// Provides feedback to the user upon successful installation of an
@@ -27,7 +30,8 @@ class Extension;
// don't specify a default icon.
//
// ExtensionInstallBubble manages its own lifetime.
-class ExtensionInstalledBubble : public content::NotificationObserver {
+class ExtensionInstalledBubble : public content::NotificationObserver,
+ public extensions::ExtensionRegistryObserver {
public:
// The behavior and content of this Bubble comes in these varieties:
enum BubbleType {
@@ -72,6 +76,15 @@ class ExtensionInstalledBubble : public content::NotificationObserver {
const content::NotificationSource& source,
const content::NotificationDetails& details) OVERRIDE;
+ // extensions::ExtensionRegistryObserver:
+ 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;
+
// The view delegate that shows the bubble. Owns us.
Delegate* delegate_;
@@ -82,6 +95,11 @@ class ExtensionInstalledBubble : public content::NotificationObserver {
BubbleType type_;
content::NotificationRegistrar registrar_;
+ // Listen to extension load, unloaded notifications.
+ ScopedObserver<extensions::ExtensionRegistry,
+ extensions::ExtensionRegistryObserver>
+ extension_registry_observer_;
+
// The number of times to retry showing the bubble if the browser action
// toolbar is animating.
int animation_wait_retries_;
« no previous file with comments | « chrome/browser/ui/extensions/extension_enable_flow.cc ('k') | chrome/browser/ui/extensions/extension_installed_bubble.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698