Commit d17e39e5 authored by calamity's avatar calamity Committed by Commit bot

Hide NativeViewHostAura correctly.

This CL fixes an issue where the NativeViewHostAura clipping window would
not be hidden correctly and steal mouse events from the experimental app
list. This CL simply hides the clipping window when the NativeViewHost
is hidden.

BUG=408877

Review URL: https://codereview.chromium.org/517143003

Cr-Commit-Position: refs/heads/master@{#293125}
parent 7d54a032
...@@ -165,6 +165,7 @@ void NativeViewHostAura::ShowWidget(int x, int y, int w, int h) { ...@@ -165,6 +165,7 @@ void NativeViewHostAura::ShowWidget(int x, int y, int w, int h) {
void NativeViewHostAura::HideWidget() { void NativeViewHostAura::HideWidget() {
host_->native_view()->Hide(); host_->native_view()->Hide();
clipping_window_.Hide();
} }
void NativeViewHostAura::SetFocus() { void NativeViewHostAura::SetFocus() {
......
...@@ -374,4 +374,24 @@ TEST_F(NativeViewHostAuraTest, Attach) { ...@@ -374,4 +374,24 @@ TEST_F(NativeViewHostAuraTest, Attach) {
DestroyHost(); DestroyHost();
} }
// Ensure the clipping window is hidden with the native view. This is a
// regression test for https://crbug.com/408877.
TEST_F(NativeViewHostAuraTest, SimpleShowAndHide) {
CreateHost();
toplevel()->SetBounds(gfx::Rect(20, 20, 100, 100));
toplevel()->Show();
host()->SetBounds(10, 10, 80, 80);
EXPECT_TRUE(clipping_window()->IsVisible());
EXPECT_TRUE(child()->IsVisible());
host()->SetVisible(false);
EXPECT_FALSE(clipping_window()->IsVisible());
EXPECT_FALSE(child()->IsVisible());
DestroyHost();
DestroyTopLevel();
}
} // namespace views } // namespace views
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