Send unhandled key event to embedder
This commit is contained in:
parent
e214ce6bc4
commit
a96cde254b
2 changed files with 15 additions and 1 deletions
|
@ -83,6 +83,17 @@ content::WebContents* WebContents::OpenURLFromTab(
|
|||
return web_contents();
|
||||
}
|
||||
|
||||
void WebContents::HandleKeyboardEvent(
|
||||
content::WebContents* source,
|
||||
const content::NativeWebKeyboardEvent& event) {
|
||||
if (!attached())
|
||||
return;
|
||||
|
||||
// Send the unhandled keyboard events back to the embedder to reprocess them.
|
||||
embedder_web_contents_->GetDelegate()->HandleKeyboardEvent(
|
||||
web_contents(), event);
|
||||
}
|
||||
|
||||
void WebContents::RenderViewDeleted(content::RenderViewHost* render_view_host) {
|
||||
base::ListValue args;
|
||||
args.AppendInteger(render_view_host->GetProcess()->GetID());
|
||||
|
|
|
@ -88,9 +88,12 @@ class WebContents : public mate::EventEmitter,
|
|||
v8::Isolate* isolate) override;
|
||||
|
||||
// content::WebContentsDelegate:
|
||||
virtual content::WebContents* OpenURLFromTab(
|
||||
content::WebContents* OpenURLFromTab(
|
||||
content::WebContents* source,
|
||||
const content::OpenURLParams& params) override;
|
||||
void HandleKeyboardEvent(
|
||||
content::WebContents* source,
|
||||
const content::NativeWebKeyboardEvent& event) override;
|
||||
|
||||
// content::WebContentsObserver:
|
||||
virtual void RenderViewDeleted(content::RenderViewHost*) override;
|
||||
|
|
Loading…
Reference in a new issue