feat: add support for HIDDevice.forget() (#34210)

* feat: add support for HIDDevice.forget()

* chore: remove whitespace

* chore: use `SetGetter` to serialize the render_frame_host

Co-authored-by: Samuel Maddock <samuel.maddock@gmail.com>

* fixup chore: use `SetGetter` to serialize the render_frame_host

* fixup after rebase

* fixup for crash on navigator.serial.getPorts()

* fixup for lint

Co-authored-by: Samuel Maddock <samuel.maddock@gmail.com>
This commit is contained in:
John Kleinschmidt 2022-05-23 15:13:18 -04:00 committed by GitHub
parent df9383cb3c
commit ba573f5583
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 359 additions and 114 deletions

View file

@ -80,8 +80,11 @@ bool ElectronHidDelegate::HasDevicePermission(
void ElectronHidDelegate::RevokeDevicePermission(
content::RenderFrameHost* render_frame_host,
const device::mojom::HidDeviceInfo& device) {
// TODO(jkleinsc) implement this for
// https://chromium-review.googlesource.com/c/chromium/src/+/3297868
auto* chooser_context = GetChooserContext(render_frame_host);
const auto& origin =
render_frame_host->GetMainFrame()->GetLastCommittedOrigin();
return chooser_context->RevokeDevicePermission(origin, device,
render_frame_host);
}
device::mojom::HidManager* ElectronHidDelegate::GetHidManager(