diff options
author | pkotwicz <pkotwicz@chromium.org> | 2015-01-12 17:05:03 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-01-13 01:05:41 +0000 |
commit | 8428d8a19507634aa35b5eb4e9d3d9c82595f889 (patch) | |
tree | 26c1e6ca617d57956c21b04cc59188bf4e1afb27 /ui/wm | |
parent | 151c8010c9c54ecd75bab276a3ac820763544da1 (diff) | |
download | chromium_src-8428d8a19507634aa35b5eb4e9d3d9c82595f889.zip chromium_src-8428d8a19507634aa35b5eb4e9d3d9c82595f889.tar.gz chromium_src-8428d8a19507634aa35b5eb4e9d3d9c82595f889.tar.bz2 |
Fix regression due to https://codereview.chromium.org/757863002
The intent of https://codereview.chromium.org/757863002 was to make whether an
aura::Window's layer has a NULL delegate not affect the aura::Window stacking
order. This CL removes the logic that I forgot to remove in the initial CL.
BUG=443433
TEST=TransientWindowStackingClientTest.StackAboveClosingWindow
Review URL: https://codereview.chromium.org/850553003
Cr-Commit-Position: refs/heads/master@{#311163}
Diffstat (limited to 'ui/wm')
-rw-r--r-- | ui/wm/core/transient_window_stacking_client.cc | 6 | ||||
-rw-r--r-- | ui/wm/core/transient_window_stacking_client_unittest.cc | 15 |
2 files changed, 15 insertions, 6 deletions
diff --git a/ui/wm/core/transient_window_stacking_client.cc b/ui/wm/core/transient_window_stacking_client.cc index 740fe99..9be72b6 100644 --- a/ui/wm/core/transient_window_stacking_client.cc +++ b/ui/wm/core/transient_window_stacking_client.cc @@ -94,12 +94,6 @@ bool TransientWindowStackingClient::AdjustStacking( *target = siblings[target_i]; } - // If we couldn't find a valid target position, don't move anything. - if (*direction == Window::STACK_ABOVE && - ((*target)->layer() && (*target)->layer()->delegate() == NULL)) { - return false; - } - return *child != *target; } diff --git a/ui/wm/core/transient_window_stacking_client_unittest.cc b/ui/wm/core/transient_window_stacking_client_unittest.cc index 7b8c127..5e37cf4 100644 --- a/ui/wm/core/transient_window_stacking_client_unittest.cc +++ b/ui/wm/core/transient_window_stacking_client_unittest.cc @@ -174,4 +174,19 @@ TEST_F(TransientWindowStackingClientTest, TransientChildrenGroupBelow) { EXPECT_EQ("2 22 21 213 211 212 1 11", ChildWindowIDsAsString(parent.get())); } +// Tests that windows can be stacked above windows with a NULL layer delegate. +// Windows have a NULL layer delegate when they are in the process of closing. +// See crbug.com/443433 +TEST_F(TransientWindowStackingClientTest, + StackAboveWindowWithNULLLayerDelegate) { + scoped_ptr<Window> parent(CreateTestWindowWithId(0, root_window())); + scoped_ptr<Window> w1(CreateTestWindowWithId(1, parent.get())); + scoped_ptr<Window> w2(CreateTestWindowWithId(2, parent.get())); + w2->layer()->set_delegate(NULL); + EXPECT_EQ(w2.get(), parent->children().back()); + + parent->StackChildAbove(w1.get(), w2.get()); + EXPECT_EQ(w1.get(), parent->children().back()); +} + } // namespace wm |