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

Unified Diff: device/bluetooth/bluetooth_device.h

Issue 2009753002: bluetooth: Make public BluetoothDevice::GetName method. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: split out name/alias 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
« no previous file with comments | « device/bluetooth/bluetooth_classic_device_mac.mm ('k') | device/bluetooth/bluetooth_device.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « device/bluetooth/bluetooth_classic_device_mac.mm ('k') | device/bluetooth/bluetooth_device.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698