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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 return; | 285 return; |
286 | 286 |
287 // The secondary display is logically on the right, but on the system (e.g. X) | 287 // The secondary display is logically on the right, but on the system (e.g. X) |
288 // layer, it's below the primary one. See UpdateDisplay() in ash_test_base.cc. | 288 // layer, it's below the primary one. See UpdateDisplay() in ash_test_base.cc. |
289 UpdateDisplay("800x600,800x600"); | 289 UpdateDisplay("800x600,800x600"); |
290 aura::Window::Windows root_windows = Shell::GetAllRootWindows(); | 290 aura::Window::Windows root_windows = Shell::GetAllRootWindows(); |
291 ASSERT_EQ(2U, root_windows.size()); | 291 ASSERT_EQ(2U, root_windows.size()); |
292 | 292 |
293 aura::test::TestWindowDelegate delegate; | 293 aura::test::TestWindowDelegate delegate; |
294 scoped_ptr<aura::Window> window(new aura::Window(&delegate)); | 294 scoped_ptr<aura::Window> window(new aura::Window(&delegate)); |
295 window->SetType(aura::client::WINDOW_TYPE_NORMAL); | 295 window->SetType(ui::wm::WINDOW_TYPE_NORMAL); |
296 window->Init(ui::LAYER_TEXTURED); | 296 window->Init(ui::LAYER_TEXTURED); |
297 ParentWindowInPrimaryRootWindow(window.get()); | 297 ParentWindowInPrimaryRootWindow(window.get()); |
298 window->SetBoundsInScreen(gfx::Rect(0, 0, 50, 60), | 298 window->SetBoundsInScreen(gfx::Rect(0, 0, 50, 60), |
299 Shell::GetScreen()->GetPrimaryDisplay()); | 299 Shell::GetScreen()->GetPrimaryDisplay()); |
300 window->Show(); | 300 window->Show(); |
301 EXPECT_TRUE(ash::wm::CanActivateWindow(window.get())); | 301 EXPECT_TRUE(ash::wm::CanActivateWindow(window.get())); |
302 ash::wm::ActivateWindow(window.get()); | 302 ash::wm::ActivateWindow(window.get()); |
303 EXPECT_EQ(root_windows[0], window->GetRootWindow()); | 303 EXPECT_EQ(root_windows[0], window->GetRootWindow()); |
304 EXPECT_EQ(root_windows[0], ash::Shell::GetTargetRootWindow()); | 304 EXPECT_EQ(root_windows[0], ash::Shell::GetTargetRootWindow()); |
305 { | 305 { |
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
718 resizer->CompleteDrag(0); | 718 resizer->CompleteDrag(0); |
719 EXPECT_EQ(1, session_delegate->num_transfer_to_desktop_of_user_calls()); | 719 EXPECT_EQ(1, session_delegate->num_transfer_to_desktop_of_user_calls()); |
720 EXPECT_NE(initial_bounds.ToString(), window->bounds().ToString()); | 720 EXPECT_NE(initial_bounds.ToString(), window->bounds().ToString()); |
721 } | 721 } |
722 } | 722 } |
723 #endif | 723 #endif |
724 | 724 |
725 | 725 |
726 } // namespace internal | 726 } // namespace internal |
727 } // namespace ash | 727 } // namespace ash |
OLD | NEW |