| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "device/bluetooth/bluetooth_low_energy_device_mac.h" | 5 #include "device/bluetooth/bluetooth_low_energy_device_mac.h" |
| 6 | 6 |
| 7 #import <CoreFoundation/CoreFoundation.h> | 7 #import <CoreFoundation/CoreFoundation.h> |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include "base/mac/mac_util.h" | 10 #include "base/mac/mac_util.h" |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 } | 262 } |
| 263 | 263 |
| 264 device::BluetoothAdapterMac* BluetoothLowEnergyDeviceMac::GetMacAdapter() { | 264 device::BluetoothAdapterMac* BluetoothLowEnergyDeviceMac::GetMacAdapter() { |
| 265 return static_cast<BluetoothAdapterMac*>(this->adapter_); | 265 return static_cast<BluetoothAdapterMac*>(this->adapter_); |
| 266 } | 266 } |
| 267 | 267 |
| 268 CBPeripheral* BluetoothLowEnergyDeviceMac::GetPeripheral() { | 268 CBPeripheral* BluetoothLowEnergyDeviceMac::GetPeripheral() { |
| 269 return peripheral_; | 269 return peripheral_; |
| 270 } | 270 } |
| 271 | 271 |
| 272 void BluetoothLowEnergyDeviceMac::DidDisconnectPeripheral() { | 272 void BluetoothLowEnergyDeviceMac::DidDisconnectPeripheral( |
| 273 BluetoothDevice::ConnectErrorCode error_code) { |
| 273 if (create_gatt_connection_error_callbacks_.empty()) { | 274 if (create_gatt_connection_error_callbacks_.empty()) { |
| 275 // TODO(http://crbug.com/585897): Need to pass the error. |
| 274 DidDisconnectGatt(); | 276 DidDisconnectGatt(); |
| 275 } else { | 277 } else { |
| 276 DidFailToConnectGatt(ERROR_FAILED); | 278 DidFailToConnectGatt(error_code); |
| 277 } | 279 } |
| 278 } | 280 } |
| OLD | NEW |