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

Unified Diff: device/bluetooth/bluetooth_classic_device_mac.mm

Issue 2009753002: bluetooth: Make public BluetoothDevice::GetName method. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge TOT Created 4 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
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];
}

Powered by Google App Engine
This is Rietveld 408576698