refactor: add NativeWindow::IsActive() (#47148)

this was already present on macOS; use in NativeWindowViews too
This commit is contained in:
Charles Kerr 2025-05-20 15:08:44 +00:00 committed by GitHub
commit 211faed848
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 7 additions and 6 deletions

View file

@ -2007,13 +2007,8 @@ void WebContents::ReadyToCommitNavigation(
// Don't focus content in an inactive window.
if (!owner_window())
return;
#if BUILDFLAG(IS_MAC)
if (!owner_window()->IsActive())
return;
#else
if (!owner_window()->widget()->IsActive())
return;
#endif
// Don't focus content after subframe navigations.
if (!navigation_handle->IsInMainFrame())
return;