Commit 6945b3cf authored by Eliot Courtney's avatar Eliot Courtney Committed by Commit Bot

Exclude the Assistant window from affecting occlusion.

This is to prevent it from triggering auto-picture-in-picture.

which causes the WebView in the assistant to cover the Youtube app while
it's playing a video does not trigger auto-PIP.

Bug: b/134793884
Test: Pressing the assistant button on eve and then selecting an option
Change-Id: Ia94c876d1fc67c6010b3625342e21f73568534b1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1671894Reviewed-by: default avatarTao Wu <wutao@chromium.org>
Reviewed-by: default avatarMitsuru Oshima <oshima@chromium.org>
Reviewed-by: default avatarXiaohui Chen <xiaohuic@chromium.org>
Commit-Queue: Eliot Courtney <edcourtney@chromium.org>
Cr-Commit-Position: refs/heads/master@{#671976}
parent 58b8718f
...@@ -262,8 +262,10 @@ const char* AssistantContainerView::GetClassName() const { ...@@ -262,8 +262,10 @@ const char* AssistantContainerView::GetClassName() const {
} }
void AssistantContainerView::AddedToWidget() { void AssistantContainerView::AddedToWidget() {
GetWidget()->GetNativeWindow()->SetEventTargeter( // Exclude the Assistant window for occlusion, so it doesn't trigger auto-pip.
std::make_unique<AssistantContainerEventTargeter>()); auto* window = GetWidget()->GetNativeWindow();
occlusion_excluder_.emplace(window);
window->SetEventTargeter(std::make_unique<AssistantContainerEventTargeter>());
} }
ax::mojom::Role AssistantContainerView::GetAccessibleWindowRole() { ax::mojom::Role AssistantContainerView::GetAccessibleWindowRole() {
......
...@@ -11,6 +11,8 @@ ...@@ -11,6 +11,8 @@
#include "ash/assistant/ui/assistant_container_view_focus_traversable.h" #include "ash/assistant/ui/assistant_container_view_focus_traversable.h"
#include "base/component_export.h" #include "base/component_export.h"
#include "base/macros.h" #include "base/macros.h"
#include "base/optional.h"
#include "ui/aura/window_occlusion_tracker.h"
#include "ui/views/bubble/bubble_dialog_delegate_view.h" #include "ui/views/bubble/bubble_dialog_delegate_view.h"
namespace ash { namespace ash {
...@@ -76,6 +78,9 @@ class COMPONENT_EXPORT(ASSISTANT_UI) AssistantContainerView ...@@ -76,6 +78,9 @@ class COMPONENT_EXPORT(ASSISTANT_UI) AssistantContainerView
std::unique_ptr<AssistantContainerViewAnimator> animator_; std::unique_ptr<AssistantContainerViewAnimator> animator_;
AssistantContainerViewFocusTraversable focus_traversable_; AssistantContainerViewFocusTraversable focus_traversable_;
base::Optional<aura::WindowOcclusionTracker::ScopedExclude>
occlusion_excluder_;
DISALLOW_COPY_AND_ASSIGN(AssistantContainerView); DISALLOW_COPY_AND_ASSIGN(AssistantContainerView);
}; };
......
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