fix: select-usb-device
should respect filters
option (#41166)
fix: select-usb-device should respect filters option
This commit is contained in:
parent
6df3443617
commit
e4d5dc138f
1 changed files with 8 additions and 0 deletions
|
@ -120,6 +120,14 @@ void UsbChooserController::GotUsbDeviceList(
|
||||||
auto* rfh = content::RenderFrameHost::FromID(render_frame_host_id_);
|
auto* rfh = content::RenderFrameHost::FromID(render_frame_host_id_);
|
||||||
v8::Isolate* isolate = JavascriptEnvironment::GetIsolate();
|
v8::Isolate* isolate = JavascriptEnvironment::GetIsolate();
|
||||||
v8::HandleScope scope(isolate);
|
v8::HandleScope scope(isolate);
|
||||||
|
|
||||||
|
// "select-usb-device" should respect |filters|.
|
||||||
|
devices.erase(std::remove_if(devices.begin(), devices.end(),
|
||||||
|
[this](const auto& device_info) {
|
||||||
|
return !DisplayDevice(*device_info);
|
||||||
|
}),
|
||||||
|
devices.end());
|
||||||
|
|
||||||
v8::Local<v8::Object> details = gin::DataObjectBuilder(isolate)
|
v8::Local<v8::Object> details = gin::DataObjectBuilder(isolate)
|
||||||
.Set("deviceList", devices)
|
.Set("deviceList", devices)
|
||||||
.Set("frame", rfh)
|
.Set("frame", rfh)
|
||||||
|
|
Loading…
Reference in a new issue