feat: add focus and blur events for WebContents (#25873)
test: add focus and blur WebContents event tests test: confirm that webcontents focus event is fired on browserwindow focus fix: mac focus event test timeout
This commit is contained in:
parent
e34d7f5d6f
commit
aeee9cfb78
4 changed files with 75 additions and 3 deletions
|
@ -1629,6 +1629,16 @@ void WebContents::DidAcquireFullscreen(content::RenderFrameHost* rfh) {
|
|||
set_fullscreen_frame(rfh);
|
||||
}
|
||||
|
||||
void WebContents::OnWebContentsFocused(
|
||||
content::RenderWidgetHost* render_widget_host) {
|
||||
Emit("focus");
|
||||
}
|
||||
|
||||
void WebContents::OnWebContentsLostFocus(
|
||||
content::RenderWidgetHost* render_widget_host) {
|
||||
Emit("blur");
|
||||
}
|
||||
|
||||
void WebContents::DOMContentLoaded(
|
||||
content::RenderFrameHost* render_frame_host) {
|
||||
auto* web_frame = WebFrameMain::FromRenderFrameHost(render_frame_host);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue