* Fix split view tab_is_active_ correction for permission manager
The BRAVE_PERMISSION_REQUEST_MANAGER_ON_VISIBILITY_CHANGED macro that
calls UpdateTabIsHiddenWithTabActivationState() is unreachable on
desktop because OnVisibilityChanged() returns early when
tab_subscriptions_ is not empty. This means OnTabActiveStateChanged()
was calling OnVisibilityChanged() expecting the correction to run, but
it never did on desktop.
Additionally, UpdateTabIsHiddenWithTabActivationState() only corrected
tab_is_active_ in one direction (true->false for inactive split tabs)
but not the reverse (false->true for the active split tab).
Fix by calling UpdateTabIsHiddenWithTabActivationState() directly from
OnTabActiveStateChanged() instead of through the unreachable macro, and
make the correction bidirectional so tab_is_active_ always matches the
split view activation state.
Resolves https://github.com/brave/brave-browser/issues/53276
* Fix IsWebContentsVisible for split view dialog visibility
Address review feedback: the test failure is about web modal dialog
visibility, not permission bubbles. The root cause is that after
Minimize()+Restore(), platform_util::IsVisible() can temporarily
return false for the active split tab. This caused the Brave macro
in WebContentsModalDialogManager::OnVisibilityChanged() to swallow
the HIDDEN->VISIBLE transition, preventing ShowNextDialog() from
being called.
Fix: Use tab->IsActivated() as the source of truth for split view
tabs in BraveBrowser::IsWebContentsVisible(), which is always
accurate regardless of platform visibility timing. Revert the
PermissionRequestManager changes from the previous attempt.
Resolvesbrave/brave-browser#53276
* Updated test code
Removed window minimize/restored state during the test.
This window change is not important factor for split tab's
modal dialog test.
Claude code suspects that minimize/retored state change could
make platform_util::IsVisible(). Let's see this intermittent test
failure happens again w/o window state change.
---------
Co-authored-by: Simon Hong <shong@brave.com>