From f60413b2c2cd4a8f2243c2a6408261b0e14bb328 Mon Sep 17 00:00:00 2001 From: Claudio DeSouza Date: Tue, 4 Jul 2023 21:43:59 +0100 Subject: [PATCH] UsbChooserController constructor updated MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Upstream has done changes to the constructor of `UsbChooserController`. We happen to depend on this class for one of our tests, as way to insert a fake. This change makes the necessary adjustments to reflect the upstream change. Chromium change: https://chromium.googlesource.com/chromium/src/+/19b0f58776f13112c4490e912ff0850b52720a36 commit 19b0f58776f13112c4490e912ff0850b52720a36 Author: François Beaufort Date: Fri Jun 23 21:18:39 2023 +0000 WebUSB: Add exclusionFilters to USBRequestDeviceOptions This CL adds a new "exclusionFilters" option in navigator.usb.requestDevice() options so that web developers can exclude from the browser picker some devices that are known to not work as expected. Intent to Ship: https://groups.google.com/a/chromium.org/g/blink-dev/c/e1mgO-m8zvQ Spec: - https://github.com/WICG/webusb/pull/233 - https://github.com/WICG/webusb/pull/235 Demo: https://usb-exclusion-filters.glitch.me/ Bug: 1455392 --- .../farbling/brave_navigator_usb_farbling_browsertest.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/browser/farbling/brave_navigator_usb_farbling_browsertest.cc b/browser/farbling/brave_navigator_usb_farbling_browsertest.cc index d6905669e8d5..6056d9a25122 100644 --- a/browser/farbling/brave_navigator_usb_farbling_browsertest.cc +++ b/browser/farbling/brave_navigator_usb_farbling_browsertest.cc @@ -120,16 +120,16 @@ class TestUsbDelegate : public ChromeUsbDelegate { std::unique_ptr RunChooser( content::RenderFrameHost& frame, - std::vector filters, + blink::mojom::WebUsbRequestDeviceOptionsPtr options, blink::mojom::WebUsbService::GetPermissionCallback callback) override { if (use_fake_chooser_) { auto chooser = std::make_unique(); chooser->ShowChooser( &frame, std::make_unique( - &frame, std::move(filters), std::move(callback))); + &frame, std::move(options), std::move(callback))); return chooser; } else { - return ChromeUsbDelegate::RunChooser(frame, std::move(filters), + return ChromeUsbDelegate::RunChooser(frame, std::move(options), std::move(callback)); } }