| Index: device/bluetooth/bluetooth_device.h
|
| diff --git a/device/bluetooth/bluetooth_device.h b/device/bluetooth/bluetooth_device.h
|
| index 6b9f24452d2224f7501e5e12b99eefbf71b8c456..d7dc0300e7f967e3ee3b8dc22b1a437e6734bf43 100644
|
| --- a/device/bluetooth/bluetooth_device.h
|
| +++ b/device/bluetooth/bluetooth_device.h
|
| @@ -17,6 +17,7 @@
|
| #include "base/containers/scoped_ptr_hash_map.h"
|
| #include "base/gtest_prod_util.h"
|
| #include "base/memory/ref_counted.h"
|
| +#include "base/optional.h"
|
| #include "base/strings/string16.h"
|
| #include "base/time/time.h"
|
| #include "device/bluetooth/bluetooth_common.h"
|
| @@ -237,6 +238,9 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothDevice {
|
| // Returns the appearance of the device.
|
| virtual uint16_t GetAppearance() const = 0;
|
|
|
| + // Returns the name of the device, which may be empty.
|
| + virtual base::Optional<std::string> GetName() const = 0;
|
| +
|
| // Returns the name of the device suitable for displaying, this may
|
| // be a synthesized string containing the address and localized type name
|
| // if the device has no obtained name.
|
| @@ -498,16 +502,12 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothDevice {
|
| BluetoothGattConnection_ErrorAfterConnection);
|
| FRIEND_TEST_ALL_PREFIXES(BluetoothTest,
|
| BluetoothGattConnection_DisconnectGatt_Cleanup);
|
| - FRIEND_TEST_ALL_PREFIXES(BluetoothTest, GetDeviceName_NullName);
|
| + FRIEND_TEST_ALL_PREFIXES(BluetoothTest, GetName_NullName);
|
| FRIEND_TEST_ALL_PREFIXES(BluetoothTest, RemoveOutdatedDevices);
|
| FRIEND_TEST_ALL_PREFIXES(BluetoothTest, RemoveOutdatedDeviceGattConnect);
|
|
|
| BluetoothDevice(BluetoothAdapter* adapter);
|
|
|
| - // Returns the internal name of the Bluetooth device, used by
|
| - // GetNameForDisplay().
|
| - virtual std::string GetDeviceName() const = 0;
|
| -
|
| // Implements platform specific operations to initiate a GATT connection.
|
| // Subclasses must also call DidConnectGatt, DidFailToConnectGatt, or
|
| // DidDisconnectGatt immediately or asynchronously as the connection state
|
|
|