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

Unified Diff: device/bluetooth/bluetooth_device_chromeos.cc

Issue 418483003: device/bluetooth: Move GATT observer methods to BluetoothAdapter::Observer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 | « device/bluetooth/bluetooth_device_chromeos.h ('k') | device/bluetooth/bluetooth_device_mac.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/bluetooth/bluetooth_device_chromeos.cc
diff --git a/device/bluetooth/bluetooth_device_chromeos.cc b/device/bluetooth/bluetooth_device_chromeos.cc
index f6072470c38a0293d08bbd8b5a5ccfb56a085272..0f1f273cb54b9b0e5f9e7a69781fcf28e63169af 100644
--- a/device/bluetooth/bluetooth_device_chromeos.cc
+++ b/device/bluetooth/bluetooth_device_chromeos.cc
@@ -153,24 +153,13 @@ BluetoothDeviceChromeOS::~BluetoothDeviceChromeOS() {
gatt_services_.clear();
for (GattServiceMap::iterator iter = gatt_services.begin();
iter != gatt_services.end(); ++iter) {
- FOR_EACH_OBSERVER(BluetoothDevice::Observer, observers_,
- GattServiceRemoved(this, iter->second));
+ DCHECK(adapter_);
+ adapter_->NotifyGattServiceRemoved(
+ static_cast<BluetoothRemoteGattServiceChromeOS*>(iter->second));
delete iter->second;
}
}
-void BluetoothDeviceChromeOS::AddObserver(
- device::BluetoothDevice::Observer* observer) {
- DCHECK(observer);
- observers_.AddObserver(observer);
-}
-
-void BluetoothDeviceChromeOS::RemoveObserver(
- device::BluetoothDevice::Observer* observer) {
- DCHECK(observer);
- observers_.RemoveObserver(observer);
-}
-
uint32 BluetoothDeviceChromeOS::GetBluetoothClass() const {
BluetoothDeviceClient::Properties* properties =
DBusThreadManager::Get()->GetBluetoothDeviceClient()->
@@ -510,8 +499,8 @@ void BluetoothDeviceChromeOS::GattServiceAdded(
DCHECK(service->object_path() == object_path);
DCHECK(service->GetUUID().IsValid());
- FOR_EACH_OBSERVER(device::BluetoothDevice::Observer, observers_,
- GattServiceAdded(this, service));
+ DCHECK(adapter_);
+ adapter_->NotifyGattServiceAdded(service);
}
void BluetoothDeviceChromeOS::GattServiceRemoved(
@@ -528,8 +517,10 @@ void BluetoothDeviceChromeOS::GattServiceRemoved(
static_cast<BluetoothRemoteGattServiceChromeOS*>(iter->second);
DCHECK(service->object_path() == object_path);
gatt_services_.erase(iter);
- FOR_EACH_OBSERVER(device::BluetoothDevice::Observer, observers_,
- GattServiceRemoved(this, service));
+
+ DCHECK(adapter_);
+ adapter_->NotifyGattServiceRemoved(service);
+
delete service;
}
« no previous file with comments | « device/bluetooth/bluetooth_device_chromeos.h ('k') | device/bluetooth/bluetooth_device_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698