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

Unified Diff: chrome/browser/extensions/api/signed_in_devices/signed_in_devices_manager.h

Issue 263393002: Remove NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED from c/b/e/api (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix test 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/extensions/api/signed_in_devices/signed_in_devices_manager.h
diff --git a/chrome/browser/extensions/api/signed_in_devices/signed_in_devices_manager.h b/chrome/browser/extensions/api/signed_in_devices/signed_in_devices_manager.h
index 291347a5e1cc946a64bdcd7b3eb4d41988796ca4..925a6ec5d6de00a4b0a124680b3f6e31575a4076 100644
--- a/chrome/browser/extensions/api/signed_in_devices/signed_in_devices_manager.h
+++ b/chrome/browser/extensions/api/signed_in_devices/signed_in_devices_manager.h
@@ -9,9 +9,11 @@
#include "base/gtest_prod_util.h"
#include "base/memory/scoped_vector.h"
+#include "base/scoped_observer.h"
#include "chrome/browser/sync/glue/synced_device_tracker.h"
#include "extensions/browser/browser_context_keyed_api_factory.h"
#include "extensions/browser/event_router.h"
+#include "extensions/browser/extension_registry_observer.h"
class Profile;
@@ -24,6 +26,7 @@ class NotificationRegistrar;
namespace extensions {
class BrowserContextKeyedAPI;
+class ExtensionRegistry;
struct EventListenerInfo;
@@ -54,7 +57,7 @@ class SignedInDevicesChangeObserver
};
class SignedInDevicesManager : public BrowserContextKeyedAPI,
- public content::NotificationObserver,
+ public ExtensionRegistryObserver,
public EventRouter::Observer {
public:
// Default constructor used for testing.
@@ -66,10 +69,11 @@ class SignedInDevicesManager : public BrowserContextKeyedAPI,
static BrowserContextKeyedAPIFactory<SignedInDevicesManager>*
GetFactoryInstance();
- // NotificationObserver:
- virtual void Observe(int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) OVERRIDE;
+ // ExtensionRegistryObserver implementation.
+ virtual void OnExtensionUnloaded(
+ content::BrowserContext* browser_context,
+ const Extension* extension,
+ UnloadedExtensionInfo::Reason reason) OVERRIDE;
// EventRouter::Observer:
virtual void OnListenerAdded(const EventListenerInfo& details) OVERRIDE;
@@ -87,9 +91,12 @@ class SignedInDevicesManager : public BrowserContextKeyedAPI,
void RemoveChangeObserverForExtension(const std::string& extension_id);
Profile* const profile_;
- content::NotificationRegistrar registrar_;
ScopedVector<SignedInDevicesChangeObserver> change_observers_;
+ // Listen to extension unloaded notification.
+ ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver>
+ extension_registry_observer_;
+
FRIEND_TEST_ALL_PREFIXES(SignedInDevicesManager, UpdateListener);
DISALLOW_COPY_AND_ASSIGN(SignedInDevicesManager);

Powered by Google App Engine
This is Rietveld 408576698