| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ash/wm/workspace_controller.h" | 5 #include "ash/wm/workspace_controller.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 | 8 |
| 9 #include "ash/ash_switches.h" | 9 #include "ash/ash_switches.h" |
| 10 #include "ash/root_window_controller.h" | 10 #include "ash/root_window_controller.h" |
| (...skipping 685 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 696 TEST_F(WorkspaceControllerTest, TransientParent) { | 696 TEST_F(WorkspaceControllerTest, TransientParent) { |
| 697 // Normal window with no transient parent. | 697 // Normal window with no transient parent. |
| 698 scoped_ptr<Window> w2(CreateTestWindow()); | 698 scoped_ptr<Window> w2(CreateTestWindow()); |
| 699 w2->SetBounds(gfx::Rect(10, 11, 250, 251)); | 699 w2->SetBounds(gfx::Rect(10, 11, 250, 251)); |
| 700 w2->Show(); | 700 w2->Show(); |
| 701 wm::ActivateWindow(w2.get()); | 701 wm::ActivateWindow(w2.get()); |
| 702 | 702 |
| 703 // Window with a transient parent. We set the transient parent to the root, | 703 // Window with a transient parent. We set the transient parent to the root, |
| 704 // which would never happen but is enough to exercise the bug. | 704 // which would never happen but is enough to exercise the bug. |
| 705 scoped_ptr<Window> w1(CreateTestWindowUnparented()); | 705 scoped_ptr<Window> w1(CreateTestWindowUnparented()); |
| 706 views::corewm::AddTransientChild( | 706 ::wm::AddTransientChild( |
| 707 Shell::GetInstance()->GetPrimaryRootWindow(), w1.get()); | 707 Shell::GetInstance()->GetPrimaryRootWindow(), w1.get()); |
| 708 w1->SetBounds(gfx::Rect(10, 11, 250, 251)); | 708 w1->SetBounds(gfx::Rect(10, 11, 250, 251)); |
| 709 ParentWindowInPrimaryRootWindow(w1.get()); | 709 ParentWindowInPrimaryRootWindow(w1.get()); |
| 710 w1->Show(); | 710 w1->Show(); |
| 711 wm::ActivateWindow(w1.get()); | 711 wm::ActivateWindow(w1.get()); |
| 712 | 712 |
| 713 // The window with the transient parent should get added to the same parent as | 713 // The window with the transient parent should get added to the same parent as |
| 714 // the normal window. | 714 // the normal window. |
| 715 EXPECT_EQ(w2->parent(), w1->parent()); | 715 EXPECT_EQ(w2->parent(), w1->parent()); |
| 716 } | 716 } |
| (...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1152 // |status_bubble| is made a transient child of |browser| and as a result | 1152 // |status_bubble| is made a transient child of |browser| and as a result |
| 1153 // owned by |browser|. | 1153 // owned by |browser|. |
| 1154 aura::test::TestWindowDelegate* status_bubble_delegate = | 1154 aura::test::TestWindowDelegate* status_bubble_delegate = |
| 1155 aura::test::TestWindowDelegate::CreateSelfDestroyingDelegate(); | 1155 aura::test::TestWindowDelegate::CreateSelfDestroyingDelegate(); |
| 1156 status_bubble_delegate->set_can_focus(false); | 1156 status_bubble_delegate->set_can_focus(false); |
| 1157 Window* status_bubble = | 1157 Window* status_bubble = |
| 1158 aura::test::CreateTestWindowWithDelegate(status_bubble_delegate, | 1158 aura::test::CreateTestWindowWithDelegate(status_bubble_delegate, |
| 1159 ui::wm::WINDOW_TYPE_POPUP, | 1159 ui::wm::WINDOW_TYPE_POPUP, |
| 1160 gfx::Rect(5, 6, 7, 8), | 1160 gfx::Rect(5, 6, 7, 8), |
| 1161 NULL); | 1161 NULL); |
| 1162 views::corewm::AddTransientChild(browser.get(), status_bubble); | 1162 ::wm::AddTransientChild(browser.get(), status_bubble); |
| 1163 ParentWindowInPrimaryRootWindow(status_bubble); | 1163 ParentWindowInPrimaryRootWindow(status_bubble); |
| 1164 status_bubble->SetName("status_bubble"); | 1164 status_bubble->SetName("status_bubble"); |
| 1165 | 1165 |
| 1166 scoped_ptr<Window> app(aura::test::CreateTestWindowWithDelegate( | 1166 scoped_ptr<Window> app(aura::test::CreateTestWindowWithDelegate( |
| 1167 NULL, ui::wm::WINDOW_TYPE_NORMAL, gfx::Rect(5, 6, 7, 8), NULL)); | 1167 NULL, ui::wm::WINDOW_TYPE_NORMAL, gfx::Rect(5, 6, 7, 8), NULL)); |
| 1168 app->SetName("app"); | 1168 app->SetName("app"); |
| 1169 ParentWindowInPrimaryRootWindow(app.get()); | 1169 ParentWindowInPrimaryRootWindow(app.get()); |
| 1170 | 1170 |
| 1171 aura::Window* parent = browser->parent(); | 1171 aura::Window* parent = browser->parent(); |
| 1172 | 1172 |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1498 target = targeter->FindTargetForEvent(root, &touch); | 1498 target = targeter->FindTargetForEvent(root, &touch); |
| 1499 if (points[i].is_target_hit) | 1499 if (points[i].is_target_hit) |
| 1500 EXPECT_EQ(window.get(), target); | 1500 EXPECT_EQ(window.get(), target); |
| 1501 else | 1501 else |
| 1502 EXPECT_NE(window.get(), target); | 1502 EXPECT_NE(window.get(), target); |
| 1503 } | 1503 } |
| 1504 } | 1504 } |
| 1505 | 1505 |
| 1506 } // namespace internal | 1506 } // namespace internal |
| 1507 } // namespace ash | 1507 } // namespace ash |
| OLD | NEW |