Index: content/browser/bluetooth/bluetooth_device_chooser_controller.cc |
diff --git a/content/browser/bluetooth/bluetooth_device_chooser_controller.cc b/content/browser/bluetooth/bluetooth_device_chooser_controller.cc |
index 4214b01ae96ff992ac2640434940729eac1dc934..6a08c29ae282d7c5fee68a2b7a759844d0c8959f 100644 |
--- a/content/browser/bluetooth/bluetooth_device_chooser_controller.cc |
+++ b/content/browser/bluetooth/bluetooth_device_chooser_controller.cc |
@@ -90,17 +90,16 @@ bool MatchesFilter(const device::BluetoothDevice& device, |
const blink::mojom::WebBluetoothScanFilterPtr& filter) { |
DCHECK(!IsEmptyOrInvalidFilter(filter)); |
- // TODO(615720): Use the upcoming GetName (was GetDeviceName). |
- const std::string device_name = base::UTF16ToUTF8(device.GetNameForDisplay()); |
- |
- if (!filter->name.is_null() && (device_name != filter->name)) { |
- return false; |
- } |
+ if (device.GetName()) { |
ortuno
2016/07/21 17:42:29
If a device doesn't have a name and name is the on
scheib
2016/07/30 02:38:13
Done.
|
+ if (!filter->name.is_null() && (device.GetName().value() != filter->name)) { |
+ return false; |
+ } |
- if (!filter->name_prefix.is_null() && |
- (!base::StartsWith(device_name, filter->name_prefix.get(), |
- base::CompareCase::SENSITIVE))) { |
- return false; |
+ if (filter->name_prefix.size() && |
+ (!base::StartsWith(device.GetName().value(), filter->name_prefix.get(), |
+ base::CompareCase::SENSITIVE))) { |
+ return false; |
+ } |
} |
if (!filter->services.is_null()) { |