Commit 5ae4f55f authored by Kazuki Takise's avatar Kazuki Takise Committed by Commit Bot

Activate PIP window after it is expanded

Android tells Chrome to activate windows through onTaskMovedToFront,
which is called by ActivityStack#moveTaskToFront. For PIP tasks,
we reparent them with reparent() and the function inserts them on
top without using moveTaskToFront, so we seem to activate them
explicitly.

confirmed the browser was properly activated.

Bug: b/123259430
Test: Exited PIP, pressed the shelf icon of the browser, and
Test: atest android.server.am.ActivityManagerPinnedStackTests
Change-Id: I7532e4b2c66a28b83168abcf3207266961c9a3a6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1485625
Commit-Queue: Kazuki Takise <takise@chromium.org>
Reviewed-by: default avatarMitsuru Oshima <oshima@chromium.org>
Cr-Commit-Position: refs/heads/master@{#638501}
parent 2e136efb
...@@ -923,12 +923,21 @@ bool ClientControlledShellSurface::OnPreWidgetCommit() { ...@@ -923,12 +923,21 @@ bool ClientControlledShellSurface::OnPreWidgetCommit() {
decorator_.reset(); // Remove rounded corners. decorator_.reset(); // Remove rounded corners.
} }
bool wasPip = window_state->IsPip();
if (client_controlled_state_->EnterNextState(window_state, if (client_controlled_state_->EnterNextState(window_state,
pending_window_state_)) { pending_window_state_)) {
client_controlled_state_->set_next_bounds_change_animation_type( client_controlled_state_->set_next_bounds_change_animation_type(
animation_type); animation_type);
} }
if (wasPip && !window_state->IsMinimized()) {
// As Android doesn't activate PIP tasks after they are expanded, we need
// to do it here explicitly.
// TODO(937738): Investigate if we can activate PIP windows inside commit.
window_state->Activate();
}
return true; return true;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment