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

Unified Diff: chrome/browser/extensions/api/system_indicator/system_indicator_manager.h

Issue 250733008: Remove NOTIFICATION_EXTENSION_UNLOADED from system_indicator API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review 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
« no previous file with comments | « no previous file | chrome/browser/extensions/api/system_indicator/system_indicator_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/system_indicator/system_indicator_manager.h
diff --git a/chrome/browser/extensions/api/system_indicator/system_indicator_manager.h b/chrome/browser/extensions/api/system_indicator/system_indicator_manager.h
index fb677408ff04c06ca8965254d23baeff6a93d874..a7d7edaf265800a167b4cd24b5a34eebde1c9962 100644
--- a/chrome/browser/extensions/api/system_indicator/system_indicator_manager.h
+++ b/chrome/browser/extensions/api/system_indicator/system_indicator_manager.h
@@ -9,12 +9,13 @@
#include <string>
#include "base/memory/linked_ptr.h"
+#include "base/scoped_observer.h"
#include "base/threading/thread_checker.h"
#include "chrome/browser/extensions/extension_action_icon_factory.h"
#include "components/keyed_service/core/keyed_service.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
-#include "extensions/browser/event_router.h"
+#include "extensions/browser/extension_registry_observer.h"
class ExtensionAction;
class Profile;
@@ -23,13 +24,14 @@ class StatusTray;
FORWARD_DECLARE_TEST(SystemIndicatorApiTest, SystemIndicator);
namespace extensions {
-
class ExtensionIndicatorIcon;
+class ExtensionRegistry;
// Keeps track of all the systemIndicator icons created for a given Profile
// that are currently visible in the UI. Use SystemIndicatorManagerFactory to
// create a SystemIndicatorManager object.
class SystemIndicatorManager : public content::NotificationObserver,
+ public ExtensionRegistryObserver,
public KeyedService {
public:
SystemIndicatorManager(Profile* profile, StatusTray* status_tray);
@@ -38,13 +40,19 @@ class SystemIndicatorManager : public content::NotificationObserver,
// KeyedService implementation.
virtual void Shutdown() OVERRIDE;
+ private:
+ FRIEND_TEST_ALL_PREFIXES(::SystemIndicatorApiTest, SystemIndicator);
+
// content::NotificationDelegate implementation.
virtual void Observe(int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) OVERRIDE;
- private:
- FRIEND_TEST_ALL_PREFIXES(::SystemIndicatorApiTest, SystemIndicator);
+ // ExtensionRegistryObserver implementation.
+ virtual void OnExtensionUnloaded(
+ content::BrowserContext* browser_context,
+ const Extension* extension,
+ UnloadedExtensionInfo::Reason reason) OVERRIDE;
// Determines whether the indicator should be hidden or shown and calls the
// appropriate function.
@@ -72,6 +80,10 @@ class SystemIndicatorManager : public content::NotificationObserver,
content::NotificationRegistrar registrar_;
base::ThreadChecker thread_checker_;
+ // Listen to extension unloaded notifications.
+ ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver>
+ extension_registry_observer_;
+
DISALLOW_COPY_AND_ASSIGN(SystemIndicatorManager);
};
« no previous file with comments | « no previous file | chrome/browser/extensions/api/system_indicator/system_indicator_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698