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

Unified Diff: device/bluetooth/bluetooth_device.cc

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_device.h ('k') | device/bluetooth/bluetooth_device_android.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/bluetooth/bluetooth_device.cc
diff --git a/device/bluetooth/bluetooth_device.cc b/device/bluetooth/bluetooth_device.cc
index 16d6619848ac32edb0da0b27e3bf00415229f2b4..bac4b638a4839a3697f52ab2df3d9ecd7c1b2065 100644
--- a/device/bluetooth/bluetooth_device.cc
+++ b/device/bluetooth/bluetooth_device.cc
@@ -47,9 +47,9 @@ BluetoothDevice::ConnectionInfo::ConnectionInfo(
BluetoothDevice::ConnectionInfo::~ConnectionInfo() {}
base::string16 BluetoothDevice::GetNameForDisplay() const {
- std::string name = GetDeviceName();
- if (!name.empty()) {
- return base::UTF8ToUTF16(name);
+ base::Optional<std::string> name = GetName();
+ if (name && !name.value().empty()) {
+ return base::UTF8ToUTF16(name.value());
} else {
return GetAddressWithLocalizedDeviceTypeName();
}
@@ -237,7 +237,7 @@ bool BluetoothDevice::IsPairable() const {
bool BluetoothDevice::IsTrustable() const {
// Sony PlayStation Dualshock3
if ((GetVendorID() == 0x054c && GetProductID() == 0x0268 &&
- GetDeviceName() == "PLAYSTATION(R)3 Controller"))
+ GetName() == std::string("PLAYSTATION(R)3 Controller")))
return true;
return false;
« no previous file with comments | « device/bluetooth/bluetooth_device.h ('k') | device/bluetooth/bluetooth_device_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698