Skip to content

Commit

Permalink
UsbChooserController constructor updated
Browse files Browse the repository at this point in the history
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 <[email protected]>
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:
    - WICG/webusb#233
    - WICG/webusb#235
    Demo: https://usb-exclusion-filters.glitch.me/

    Bug: 1455392
  • Loading branch information
cdesouza-chromium committed Sep 5, 2023
1 parent 6a0ce6c commit dfe1fd6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions browser/farbling/brave_navigator_usb_farbling_browsertest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -120,16 +120,16 @@ class TestUsbDelegate : public ChromeUsbDelegate {

std::unique_ptr<content::UsbChooser> RunChooser(
content::RenderFrameHost& frame,
std::vector<device::mojom::UsbDeviceFilterPtr> filters,
blink::mojom::WebUsbRequestDeviceOptionsPtr options,
blink::mojom::WebUsbService::GetPermissionCallback callback) override {
if (use_fake_chooser_) {
auto chooser = std::make_unique<FakeUsbChooser>();
chooser->ShowChooser(
&frame, std::make_unique<UsbChooserController>(
&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));
}
}
Expand Down

0 comments on commit dfe1fd6

Please sign in to comment.