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

Unified Diff: chrome/browser/extensions/api/cast_devices_private/cast_devices_private_api.h

Issue 1567103005: Replace base::CallbackList with base::ObserverList in CastConfigDelegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Replace with ObserverList instead of base::Callback Created 4 years, 11 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/cast_devices_private/cast_devices_private_api.h
diff --git a/chrome/browser/extensions/api/cast_devices_private/cast_devices_private_api.h b/chrome/browser/extensions/api/cast_devices_private/cast_devices_private_api.h
index 7f4da06c64c332cb563e8ee2cf26122a83abccd0..78905889f533f78f29e5898c41d814e1f9c9f325 100644
--- a/chrome/browser/extensions/api/cast_devices_private/cast_devices_private_api.h
+++ b/chrome/browser/extensions/api/cast_devices_private/cast_devices_private_api.h
@@ -10,6 +10,7 @@
#include "ash/cast_config_delegate.h"
#include "base/callback_list.h"
#include "base/macros.h"
+#include "base/observer_list.h"
#include "extensions/browser/browser_context_keyed_api_factory.h"
#include "extensions/browser/extension_function.h"
@@ -23,10 +24,10 @@ class CastDeviceUpdateListeners : public BrowserContextKeyedAPI {
// Fetch an instance for the given context.
stevenjb 2016/01/12 23:31:49 s/Fetch/Fetches/ (while you're in here)
jdufault 2016/01/12 23:59:22 Done.
static CastDeviceUpdateListeners* Get(content::BrowserContext* context);
- // Register a function that will be invoked only when a new device update is
+ // Set the function that will be invoked only when a new device update is
stevenjb 2016/01/12 23:31:50 s/Set/Sets/
jdufault 2016/01/12 23:59:22 Done.
// available.
- ash::CastConfigDelegate::DeviceUpdateSubscription RegisterCallback(
- const ash::CastConfigDelegate::ReceiversAndActivitesCallback& callback);
+ void AddObserver(ash::CastConfigDelegate::Observer* observer);
+ void RemoveObserver(ash::CastConfigDelegate::Observer* observer);
// BrowserContextKeyedAPI implementation:
static BrowserContextKeyedAPIFactory<CastDeviceUpdateListeners>*
@@ -40,7 +41,7 @@ class CastDeviceUpdateListeners : public BrowserContextKeyedAPI {
friend class CastDevicesPrivateUpdateDevicesFunction; // For NotifyCallbacks.
void NotifyCallbacks(const ReceiverAndActivityList& devices);
- base::CallbackList<void(const ReceiverAndActivityList&)> callback_list_;
+ base::ObserverList<ash::CastConfigDelegate::Observer> observer_list_;
friend class BrowserContextKeyedAPIFactory<CastDeviceUpdateListeners>;

Powered by Google App Engine
This is Rietveld 408576698