Spec: https://webbluetoothcg.github.io/web-bluetooth/#dom-requestdeviceoptions-acceptalldevices
WIP at https://codereview.chromium.org/2449813002/
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/cfcd3337a6ede677e625c08f10417569c94d46a6 commit cfcd3337a6ede677e625c08f10417569c94d46a6 Author: ortuno <ortuno@chromium.org> Date: Mon Dec 05 00:24:40 2016 bluetooth: Implement acceptAllDevices When acceptAllDevices is true the chooser will show all devices in range. BUG= 654918 Review-Url: https://codereview.chromium.org/2510323002 Cr-Commit-Position: refs/heads/master@{#436209} [modify] https://crrev.com/cfcd3337a6ede677e625c08f10417569c94d46a6/content/browser/bad_message.h [modify] https://crrev.com/cfcd3337a6ede677e625c08f10417569c94d46a6/content/browser/bluetooth/bluetooth_allowed_devices_map.cc [modify] https://crrev.com/cfcd3337a6ede677e625c08f10417569c94d46a6/content/browser/bluetooth/bluetooth_allowed_devices_map_unittest.cc [modify] https://crrev.com/cfcd3337a6ede677e625c08f10417569c94d46a6/content/browser/bluetooth/bluetooth_device_chooser_controller.cc [modify] https://crrev.com/cfcd3337a6ede677e625c08f10417569c94d46a6/content/browser/bluetooth/bluetooth_metrics.cc [modify] https://crrev.com/cfcd3337a6ede677e625c08f10417569c94d46a6/content/renderer/bluetooth/bluetooth_type_converters.cc [modify] https://crrev.com/cfcd3337a6ede677e625c08f10417569c94d46a6/content/shell/browser/layout_test/layout_test_bluetooth_adapter_provider.cc [modify] https://crrev.com/cfcd3337a6ede677e625c08f10417569c94d46a6/content/shell/browser/layout_test/layout_test_bluetooth_adapter_provider.h [add] https://crrev.com/cfcd3337a6ede677e625c08f10417569c94d46a6/third_party/WebKit/LayoutTests/bluetooth/requestDevice/acceptAllDevices/device-with-empty-name.html [add] https://crrev.com/cfcd3337a6ede677e625c08f10417569c94d46a6/third_party/WebKit/LayoutTests/bluetooth/requestDevice/acceptAllDevices/device-with-name.html [add] https://crrev.com/cfcd3337a6ede677e625c08f10417569c94d46a6/third_party/WebKit/LayoutTests/bluetooth/requestDevice/acceptAllDevices/device-with-no-name.html [add] https://crrev.com/cfcd3337a6ede677e625c08f10417569c94d46a6/third_party/WebKit/LayoutTests/bluetooth/requestDevice/acceptAllDevices/device-with-uuids.html [add] https://crrev.com/cfcd3337a6ede677e625c08f10417569c94d46a6/third_party/WebKit/LayoutTests/bluetooth/requestDevice/acceptAllDevices/optional-services-missing.html [add] https://crrev.com/cfcd3337a6ede677e625c08f10417569c94d46a6/third_party/WebKit/LayoutTests/bluetooth/requestDevice/acceptAllDevices/optional-services-present.html [add] https://crrev.com/cfcd3337a6ede677e625c08f10417569c94d46a6/third_party/WebKit/LayoutTests/bluetooth/requestDevice/canonicalizeFilter/filters-xor-acceptAllDevices.html [delete] https://crrev.com/ba78be88a98b57c9e4195c59a26156a4c3cf4765/third_party/WebKit/LayoutTests/bluetooth/requestDevice/canonicalizeFilter/no-filters-member.html [modify] https://crrev.com/cfcd3337a6ede677e625c08f10417569c94d46a6/third_party/WebKit/Source/modules/bluetooth/Bluetooth.cpp [modify] https://crrev.com/cfcd3337a6ede677e625c08f10417569c94d46a6/third_party/WebKit/Source/modules/bluetooth/RequestDeviceOptions.idl [modify] https://crrev.com/cfcd3337a6ede677e625c08f10417569c94d46a6/third_party/WebKit/public/platform/modules/bluetooth/WebRequestDeviceOptions.h [modify] https://crrev.com/cfcd3337a6ede677e625c08f10417569c94d46a6/third_party/WebKit/public/platform/modules/bluetooth/web_bluetooth.mojom [modify] https://crrev.com/cfcd3337a6ede677e625c08f10417569c94d46a6/tools/metrics/histograms/histograms.xml
Verified in Chrome Canary for macOS 57.0.2943.0. Great work Gio!
Your change meets the bar and is auto-approved for M56 (branch: 2924)
Nit! ortuno, I've noticed that https://beaufortfrancois.github.io/samples/web-bluetooth/device-info.html?allDevices=true&service=battery_service was failing and returning "TypeError: Failed to execute 'requestDevice' on 'Bluetooth': Either 'filters' should be present or 'acceptAllDevices' should be true, but not both." According to https://webbluetoothcg.github.io/web-bluetooth/#example-disallowed-filters, it should be allowed to use acceptAllDevices AND filters at the same time.
hmm not sure what you mean? That's a list of arguments that would cause a TypeError
I'm thinking this was due to mis-reading the examples -- which I did too. I've updated the example text to note that nearly all of these are invalid: https://webbluetoothcg.github.io/web-bluetooth/#example-disallowed-filters
Thanks Vince! It makes it clear now. Sorry for that Gio ;)
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/e893975dc2937a712f5ffcc14f2892705a286cdf commit e893975dc2937a712f5ffcc14f2892705a286cdf Author: Giovanni Ortuño Urquidi <ortuno@chromium.org> Date: Thu Dec 08 00:57:31 2016 bluetooth: Implement acceptAllDevices When acceptAllDevices is true the chooser will show all devices in range. BUG= 654918 Review URL: https://codereview.chromium.org/2557963003 . Review-Url: https://codereview.chromium.org/2510323002 Cr-Original-Commit-Position: refs/heads/master@{#436209} Cr-Commit-Position: refs/branch-heads/2924@{#396} Cr-Branched-From: 3a87aecc31cd1ffe751dd72c04e5a96a1fc8108a-refs/heads/master@{#433059} [modify] https://crrev.com/e893975dc2937a712f5ffcc14f2892705a286cdf/content/browser/bad_message.h [modify] https://crrev.com/e893975dc2937a712f5ffcc14f2892705a286cdf/content/browser/bluetooth/bluetooth_allowed_devices_map.cc [modify] https://crrev.com/e893975dc2937a712f5ffcc14f2892705a286cdf/content/browser/bluetooth/bluetooth_allowed_devices_map_unittest.cc [modify] https://crrev.com/e893975dc2937a712f5ffcc14f2892705a286cdf/content/browser/bluetooth/bluetooth_device_chooser_controller.cc [modify] https://crrev.com/e893975dc2937a712f5ffcc14f2892705a286cdf/content/browser/bluetooth/bluetooth_metrics.cc [modify] https://crrev.com/e893975dc2937a712f5ffcc14f2892705a286cdf/content/renderer/bluetooth/bluetooth_type_converters.cc [modify] https://crrev.com/e893975dc2937a712f5ffcc14f2892705a286cdf/content/shell/browser/layout_test/layout_test_bluetooth_adapter_provider.cc [modify] https://crrev.com/e893975dc2937a712f5ffcc14f2892705a286cdf/content/shell/browser/layout_test/layout_test_bluetooth_adapter_provider.h [add] https://crrev.com/e893975dc2937a712f5ffcc14f2892705a286cdf/third_party/WebKit/LayoutTests/bluetooth/requestDevice/acceptAllDevices/device-with-empty-name.html [add] https://crrev.com/e893975dc2937a712f5ffcc14f2892705a286cdf/third_party/WebKit/LayoutTests/bluetooth/requestDevice/acceptAllDevices/device-with-name.html [add] https://crrev.com/e893975dc2937a712f5ffcc14f2892705a286cdf/third_party/WebKit/LayoutTests/bluetooth/requestDevice/acceptAllDevices/device-with-no-name.html [add] https://crrev.com/e893975dc2937a712f5ffcc14f2892705a286cdf/third_party/WebKit/LayoutTests/bluetooth/requestDevice/acceptAllDevices/device-with-uuids.html [add] https://crrev.com/e893975dc2937a712f5ffcc14f2892705a286cdf/third_party/WebKit/LayoutTests/bluetooth/requestDevice/acceptAllDevices/optional-services-missing.html [add] https://crrev.com/e893975dc2937a712f5ffcc14f2892705a286cdf/third_party/WebKit/LayoutTests/bluetooth/requestDevice/acceptAllDevices/optional-services-present.html [add] https://crrev.com/e893975dc2937a712f5ffcc14f2892705a286cdf/third_party/WebKit/LayoutTests/bluetooth/requestDevice/canonicalizeFilter/filters-xor-acceptAllDevices.html [delete] https://crrev.com/a4e3e0ff2a88903e6636bb3f782adb51060a1ebc/third_party/WebKit/LayoutTests/bluetooth/requestDevice/canonicalizeFilter/no-filters-member.html [modify] https://crrev.com/e893975dc2937a712f5ffcc14f2892705a286cdf/third_party/WebKit/Source/modules/bluetooth/Bluetooth.cpp [modify] https://crrev.com/e893975dc2937a712f5ffcc14f2892705a286cdf/third_party/WebKit/Source/modules/bluetooth/RequestDeviceOptions.idl [modify] https://crrev.com/e893975dc2937a712f5ffcc14f2892705a286cdf/third_party/WebKit/public/platform/modules/bluetooth/WebRequestDeviceOptions.h [modify] https://crrev.com/e893975dc2937a712f5ffcc14f2892705a286cdf/third_party/WebKit/public/platform/modules/bluetooth/web_bluetooth.mojom [modify] https://crrev.com/e893975dc2937a712f5ffcc14f2892705a286cdf/tools/metrics/histograms/histograms.xml
Comment 1 by scheib@chromium.org
, Oct 17 2016