Chromium Code Reviews| Index: device/bluetooth/bluetooth_classic_device_mac.mm |
| diff --git a/device/bluetooth/bluetooth_classic_device_mac.mm b/device/bluetooth/bluetooth_classic_device_mac.mm |
| index d14f2703c98ed2b8b4ca45cf78a5044726947094..bbf7757934e620c054edc717590078e225a60c0a 100644 |
| --- a/device/bluetooth/bluetooth_classic_device_mac.mm |
| +++ b/device/bluetooth/bluetooth_classic_device_mac.mm |
| @@ -71,10 +71,6 @@ uint32_t BluetoothClassicDeviceMac::GetBluetoothClass() const { |
| return [device_ classOfDevice]; |
| } |
| -std::string BluetoothClassicDeviceMac::GetDeviceName() const { |
| - return base::SysNSStringToUTF8([device_ name]); |
| -} |
| - |
| void BluetoothClassicDeviceMac::CreateGattConnectionImpl() { |
| // Classic devices do not support GATT connection. |
| DidFailToConnectGatt(ERROR_UNSUPPORTED_DEVICE); |
| @@ -110,6 +106,12 @@ uint16_t BluetoothClassicDeviceMac::GetAppearance() const { |
| return 0; |
| } |
| +base::Optional<std::string> BluetoothClassicDeviceMac::GetName() const { |
| + if ([device_ name]) |
| + return base::Optional<std::string>(base::SysNSStringToUTF8([device_ name])); |
| + return base::Optional<std::string>(); |
|
ortuno
2016/07/14 21:11:41
any reason why you don't use base::make_optional a
scheib
2016/07/16 00:21:36
Done.
|
| +} |
| + |
| bool BluetoothClassicDeviceMac::IsPaired() const { |
| return [device_ isPaired]; |
| } |