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

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

Issue 1567103005: Replace base::CallbackList with base::ObserverList in CastConfigDelegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Add TODO for proper fix 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.cc
diff --git a/chrome/browser/extensions/api/cast_devices_private/cast_devices_private_api.cc b/chrome/browser/extensions/api/cast_devices_private/cast_devices_private_api.cc
index bab8394e7b78b72c24c2e7fcf6bc3815728bff41..ab944b2499393b016485cb89c2ef8889096d406d 100644
--- a/chrome/browser/extensions/api/cast_devices_private/cast_devices_private_api.cc
+++ b/chrome/browser/extensions/api/cast_devices_private/cast_devices_private_api.cc
@@ -65,15 +65,20 @@ CastDeviceUpdateListeners::CastDeviceUpdateListeners(
CastDeviceUpdateListeners::~CastDeviceUpdateListeners() {}
-ash::CastConfigDelegate::DeviceUpdateSubscription
-CastDeviceUpdateListeners::RegisterCallback(
- const ash::CastConfigDelegate::ReceiversAndActivitesCallback& callback) {
- return callback_list_.Add(callback);
+void CastDeviceUpdateListeners::AddObserver(
+ ash::CastConfigDelegate::Observer* observer) {
+ observer_list_.AddObserver(observer);
+}
+
+void CastDeviceUpdateListeners::RemoveObserver(
+ ash::CastConfigDelegate::Observer* observer) {
+ observer_list_.RemoveObserver(observer);
}
void CastDeviceUpdateListeners::NotifyCallbacks(
const ReceiverAndActivityList& devices) {
- callback_list_.Notify(devices);
+ FOR_EACH_OBSERVER(ash::CastConfigDelegate::Observer, observer_list_,
+ OnDevicesUpdated(devices));
}
CastDevicesPrivateUpdateDevicesFunction::

Powered by Google App Engine
This is Rietveld 408576698