parent
cbc1ee5775
commit
672539187c
3 changed files with 19 additions and 6 deletions
|
@ -56,10 +56,7 @@ bool ElectronSerialDelegate::HasPortPermission(
|
|||
content::RenderFrameHost* frame,
|
||||
const device::mojom::SerialPortInfo& port) {
|
||||
auto* web_contents = content::WebContents::FromRenderFrameHost(frame);
|
||||
auto* browser_context = web_contents->GetBrowserContext();
|
||||
auto* chooser_context =
|
||||
SerialChooserContextFactory::GetForBrowserContext(browser_context);
|
||||
return chooser_context->HasPortPermission(
|
||||
return GetChooserContext(frame)->HasPortPermission(
|
||||
web_contents->GetPrimaryMainFrame()->GetLastCommittedOrigin(), port,
|
||||
frame);
|
||||
}
|
||||
|
@ -91,8 +88,7 @@ void ElectronSerialDelegate::RevokePortPermissionWebInitiated(
|
|||
const device::mojom::SerialPortInfo* ElectronSerialDelegate::GetPortInfo(
|
||||
content::RenderFrameHost* frame,
|
||||
const base::UnguessableToken& token) {
|
||||
// TODO(nornagon/jkleinsc): pass this on to the chooser context
|
||||
return nullptr;
|
||||
return GetChooserContext(frame)->GetPortInfo(token);
|
||||
}
|
||||
|
||||
SerialChooserController* ElectronSerialDelegate::ControllerForFrame(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue