OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/drag_window_resizer.h" | 5 #include "ash/wm/drag_window_resizer.h" |
6 | 6 |
7 #include "ash/display/mouse_cursor_event_filter.h" | 7 #include "ash/display/mouse_cursor_event_filter.h" |
8 #include "ash/root_window_controller.h" | 8 #include "ash/root_window_controller.h" |
9 #include "ash/shelf/shelf_layout_manager.h" | 9 #include "ash/shelf/shelf_layout_manager.h" |
10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 virtual void SetUp() OVERRIDE { | 47 virtual void SetUp() OVERRIDE { |
48 AshTestBase::SetUp(); | 48 AshTestBase::SetUp(); |
49 UpdateDisplay(base::StringPrintf("800x%d", kRootHeight)); | 49 UpdateDisplay(base::StringPrintf("800x%d", kRootHeight)); |
50 | 50 |
51 aura::Window* root = Shell::GetPrimaryRootWindow(); | 51 aura::Window* root = Shell::GetPrimaryRootWindow(); |
52 gfx::Rect root_bounds(root->bounds()); | 52 gfx::Rect root_bounds(root->bounds()); |
53 EXPECT_EQ(kRootHeight, root_bounds.height()); | 53 EXPECT_EQ(kRootHeight, root_bounds.height()); |
54 EXPECT_EQ(800, root_bounds.width()); | 54 EXPECT_EQ(800, root_bounds.width()); |
55 Shell::GetInstance()->SetDisplayWorkAreaInsets(root, gfx::Insets()); | 55 Shell::GetInstance()->SetDisplayWorkAreaInsets(root, gfx::Insets()); |
56 window_.reset(new aura::Window(&delegate_)); | 56 window_.reset(new aura::Window(&delegate_)); |
57 window_->SetType(aura::client::WINDOW_TYPE_NORMAL); | 57 window_->SetType(ui::wm::WINDOW_TYPE_NORMAL); |
58 window_->Init(ui::LAYER_NOT_DRAWN); | 58 window_->Init(ui::LAYER_NOT_DRAWN); |
59 ParentWindowInPrimaryRootWindow(window_.get()); | 59 ParentWindowInPrimaryRootWindow(window_.get()); |
60 window_->set_id(1); | 60 window_->set_id(1); |
61 | 61 |
62 always_on_top_window_.reset(new aura::Window(&delegate2_)); | 62 always_on_top_window_.reset(new aura::Window(&delegate2_)); |
63 always_on_top_window_->SetType(aura::client::WINDOW_TYPE_NORMAL); | 63 always_on_top_window_->SetType(ui::wm::WINDOW_TYPE_NORMAL); |
64 always_on_top_window_->SetProperty(aura::client::kAlwaysOnTopKey, true); | 64 always_on_top_window_->SetProperty(aura::client::kAlwaysOnTopKey, true); |
65 always_on_top_window_->Init(ui::LAYER_NOT_DRAWN); | 65 always_on_top_window_->Init(ui::LAYER_NOT_DRAWN); |
66 ParentWindowInPrimaryRootWindow(always_on_top_window_.get()); | 66 ParentWindowInPrimaryRootWindow(always_on_top_window_.get()); |
67 always_on_top_window_->set_id(2); | 67 always_on_top_window_->set_id(2); |
68 | 68 |
69 system_modal_window_.reset(new aura::Window(&delegate3_)); | 69 system_modal_window_.reset(new aura::Window(&delegate3_)); |
70 system_modal_window_->SetType(aura::client::WINDOW_TYPE_NORMAL); | 70 system_modal_window_->SetType(ui::wm::WINDOW_TYPE_NORMAL); |
71 system_modal_window_->SetProperty(aura::client::kModalKey, | 71 system_modal_window_->SetProperty(aura::client::kModalKey, |
72 ui::MODAL_TYPE_SYSTEM); | 72 ui::MODAL_TYPE_SYSTEM); |
73 system_modal_window_->Init(ui::LAYER_NOT_DRAWN); | 73 system_modal_window_->Init(ui::LAYER_NOT_DRAWN); |
74 ParentWindowInPrimaryRootWindow(system_modal_window_.get()); | 74 ParentWindowInPrimaryRootWindow(system_modal_window_.get()); |
75 system_modal_window_->set_id(3); | 75 system_modal_window_->set_id(3); |
76 | 76 |
77 transient_child_ = new aura::Window(&delegate4_); | 77 transient_child_ = new aura::Window(&delegate4_); |
78 transient_child_->SetType(aura::client::WINDOW_TYPE_NORMAL); | 78 transient_child_->SetType(ui::wm::WINDOW_TYPE_NORMAL); |
79 transient_child_->Init(ui::LAYER_NOT_DRAWN); | 79 transient_child_->Init(ui::LAYER_NOT_DRAWN); |
80 ParentWindowInPrimaryRootWindow(transient_child_); | 80 ParentWindowInPrimaryRootWindow(transient_child_); |
81 transient_child_->set_id(4); | 81 transient_child_->set_id(4); |
82 | 82 |
83 transient_parent_.reset(new aura::Window(&delegate5_)); | 83 transient_parent_.reset(new aura::Window(&delegate5_)); |
84 transient_parent_->SetType(aura::client::WINDOW_TYPE_NORMAL); | 84 transient_parent_->SetType(ui::wm::WINDOW_TYPE_NORMAL); |
85 transient_parent_->Init(ui::LAYER_NOT_DRAWN); | 85 transient_parent_->Init(ui::LAYER_NOT_DRAWN); |
86 ParentWindowInPrimaryRootWindow(transient_parent_.get()); | 86 ParentWindowInPrimaryRootWindow(transient_parent_.get()); |
87 transient_parent_->AddTransientChild(transient_child_); | 87 transient_parent_->AddTransientChild(transient_child_); |
88 transient_parent_->set_id(5); | 88 transient_parent_->set_id(5); |
89 | 89 |
90 panel_window_.reset(new aura::Window(&delegate6_)); | 90 panel_window_.reset(new aura::Window(&delegate6_)); |
91 panel_window_->SetType(aura::client::WINDOW_TYPE_PANEL); | 91 panel_window_->SetType(ui::wm::WINDOW_TYPE_PANEL); |
92 panel_window_->Init(ui::LAYER_NOT_DRAWN); | 92 panel_window_->Init(ui::LAYER_NOT_DRAWN); |
93 ParentWindowInPrimaryRootWindow(panel_window_.get()); | 93 ParentWindowInPrimaryRootWindow(panel_window_.get()); |
94 } | 94 } |
95 | 95 |
96 virtual void TearDown() OVERRIDE { | 96 virtual void TearDown() OVERRIDE { |
97 window_.reset(); | 97 window_.reset(); |
98 always_on_top_window_.reset(); | 98 always_on_top_window_.reset(); |
99 system_modal_window_.reset(); | 99 system_modal_window_.reset(); |
100 transient_parent_.reset(); | 100 transient_parent_.reset(); |
101 panel_window_.reset(); | 101 panel_window_.reset(); |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 return; | 232 return; |
233 | 233 |
234 // The secondary display is logically on the right, but on the system (e.g. X) | 234 // The secondary display is logically on the right, but on the system (e.g. X) |
235 // layer, it's below the primary one. See UpdateDisplay() in ash_test_base.cc. | 235 // layer, it's below the primary one. See UpdateDisplay() in ash_test_base.cc. |
236 UpdateDisplay("800x600,800x600"); | 236 UpdateDisplay("800x600,800x600"); |
237 aura::Window::Windows root_windows = Shell::GetAllRootWindows(); | 237 aura::Window::Windows root_windows = Shell::GetAllRootWindows(); |
238 ASSERT_EQ(2U, root_windows.size()); | 238 ASSERT_EQ(2U, root_windows.size()); |
239 | 239 |
240 aura::test::TestWindowDelegate delegate; | 240 aura::test::TestWindowDelegate delegate; |
241 scoped_ptr<aura::Window> window(new aura::Window(&delegate)); | 241 scoped_ptr<aura::Window> window(new aura::Window(&delegate)); |
242 window->SetType(aura::client::WINDOW_TYPE_NORMAL); | 242 window->SetType(ui::wm::WINDOW_TYPE_NORMAL); |
243 window->Init(ui::LAYER_TEXTURED); | 243 window->Init(ui::LAYER_TEXTURED); |
244 ParentWindowInPrimaryRootWindow(window.get()); | 244 ParentWindowInPrimaryRootWindow(window.get()); |
245 window->SetBoundsInScreen(gfx::Rect(0, 0, 50, 60), | 245 window->SetBoundsInScreen(gfx::Rect(0, 0, 50, 60), |
246 Shell::GetScreen()->GetPrimaryDisplay()); | 246 Shell::GetScreen()->GetPrimaryDisplay()); |
247 window->Show(); | 247 window->Show(); |
248 EXPECT_TRUE(ash::wm::CanActivateWindow(window.get())); | 248 EXPECT_TRUE(ash::wm::CanActivateWindow(window.get())); |
249 ash::wm::ActivateWindow(window.get()); | 249 ash::wm::ActivateWindow(window.get()); |
250 EXPECT_EQ(root_windows[0], window->GetRootWindow()); | 250 EXPECT_EQ(root_windows[0], window->GetRootWindow()); |
251 EXPECT_EQ(root_windows[0], ash::Shell::GetTargetRootWindow()); | 251 EXPECT_EQ(root_windows[0], ash::Shell::GetTargetRootWindow()); |
252 { | 252 { |
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
665 resizer->CompleteDrag(0); | 665 resizer->CompleteDrag(0); |
666 EXPECT_EQ(1, session_delegate->num_transfer_to_desktop_of_user_calls()); | 666 EXPECT_EQ(1, session_delegate->num_transfer_to_desktop_of_user_calls()); |
667 EXPECT_NE(initial_bounds.ToString(), window->bounds().ToString()); | 667 EXPECT_NE(initial_bounds.ToString(), window->bounds().ToString()); |
668 } | 668 } |
669 } | 669 } |
670 #endif | 670 #endif |
671 | 671 |
672 | 672 |
673 } // namespace internal | 673 } // namespace internal |
674 } // namespace ash | 674 } // namespace ash |
OLD | NEW |