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

Unified Diff: content/renderer/bluetooth/bluetooth_type_converters.cc

Issue 2510323002: bluetooth: Implement acceptAllDevices (Closed)
Patch Set: clean up Created 4 years 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: content/renderer/bluetooth/bluetooth_type_converters.cc
diff --git a/content/renderer/bluetooth/bluetooth_type_converters.cc b/content/renderer/bluetooth/bluetooth_type_converters.cc
index 5055d7c76df9fb31ae3b644f68d885e33d4e9c84..55a0d8bd8e2ffce4b3bfe3ab2bd737ed350445bb 100644
--- a/content/renderer/bluetooth/bluetooth_type_converters.cc
+++ b/content/renderer/bluetooth/bluetooth_type_converters.cc
@@ -40,14 +40,21 @@ TypeConverter<blink::mojom::WebBluetoothRequestDeviceOptionsPtr,
blink::mojom::WebBluetoothRequestDeviceOptionsPtr options =
blink::mojom::WebBluetoothRequestDeviceOptions::New();
- for (const auto& filter : web_options.filters) {
- options->filters.push_back(blink::mojom::WebBluetoothScanFilter::From<
- blink::WebBluetoothScanFilter>(filter));
+ options->accept_all_devices = web_options.acceptAllDevices;
+
+ if (web_options.hasFilters) {
+ options->filters.emplace();
+ for (const auto& filter : web_options.filters) {
+ options->filters->push_back(blink::mojom::WebBluetoothScanFilter::From<
+ blink::WebBluetoothScanFilter>(filter));
+ }
}
+
for (const auto& optional_service : web_options.optionalServices) {
options->optional_services.push_back(
device::BluetoothUUID(optional_service.utf8()));
}
+
return options;
}

Powered by Google App Engine
This is Rietveld 408576698