| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/common/wm/maximize_mode/maximize_mode_window_manager.h" | 5 #include "ash/common/wm/maximize_mode/maximize_mode_window_manager.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "ash/aura/wm_window_aura.h" | |
| 10 #include "ash/common/ash_switches.h" | 9 #include "ash/common/ash_switches.h" |
| 11 #include "ash/common/shelf/wm_shelf.h" | 10 #include "ash/common/shelf/wm_shelf.h" |
| 12 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" | 11 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" |
| 13 #include "ash/common/wm/mru_window_tracker.h" | 12 #include "ash/common/wm/mru_window_tracker.h" |
| 14 #include "ash/common/wm/overview/window_selector_controller.h" | 13 #include "ash/common/wm/overview/window_selector_controller.h" |
| 15 #include "ash/common/wm/switchable_windows.h" | 14 #include "ash/common/wm/switchable_windows.h" |
| 16 #include "ash/common/wm/window_state.h" | 15 #include "ash/common/wm/window_state.h" |
| 17 #include "ash/common/wm/window_state_observer.h" | 16 #include "ash/common/wm/window_state_observer.h" |
| 18 #include "ash/common/wm/wm_event.h" | 17 #include "ash/common/wm/wm_event.h" |
| 19 #include "ash/common/wm_shell.h" | 18 #include "ash/common/wm_shell.h" |
| 19 #include "ash/common/wm_window.h" |
| 20 #include "ash/root_window_controller.h" | 20 #include "ash/root_window_controller.h" |
| 21 #include "ash/screen_util.h" | 21 #include "ash/screen_util.h" |
| 22 #include "ash/shell.h" | 22 #include "ash/shell.h" |
| 23 #include "ash/test/ash_test_base.h" | 23 #include "ash/test/ash_test_base.h" |
| 24 #include "ash/test/shell_test_api.h" | 24 #include "ash/test/shell_test_api.h" |
| 25 #include "ash/wm/window_properties.h" | 25 #include "ash/wm/window_properties.h" |
| 26 #include "ash/wm/window_state_aura.h" | 26 #include "ash/wm/window_state_aura.h" |
| 27 #include "ash/wm/window_util.h" | 27 #include "ash/wm/window_util.h" |
| 28 #include "base/command_line.h" | 28 #include "base/command_line.h" |
| 29 #include "base/strings/stringprintf.h" | 29 #include "base/strings/stringprintf.h" |
| (...skipping 733 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 763 CreateWindow(ui::wm::WINDOW_TYPE_NORMAL, rect)); | 763 CreateWindow(ui::wm::WINDOW_TYPE_NORMAL, rect)); |
| 764 std::unique_ptr<aura::Window> w3( | 764 std::unique_ptr<aura::Window> w3( |
| 765 CreateWindow(ui::wm::WINDOW_TYPE_NORMAL, rect)); | 765 CreateWindow(ui::wm::WINDOW_TYPE_NORMAL, rect)); |
| 766 std::unique_ptr<aura::Window> w4( | 766 std::unique_ptr<aura::Window> w4( |
| 767 CreateFixedSizeNonMaximizableWindow(ui::wm::WINDOW_TYPE_NORMAL, rect)); | 767 CreateFixedSizeNonMaximizableWindow(ui::wm::WINDOW_TYPE_NORMAL, rect)); |
| 768 std::unique_ptr<aura::Window> w5( | 768 std::unique_ptr<aura::Window> w5( |
| 769 CreateWindow(ui::wm::WINDOW_TYPE_NORMAL, rect)); | 769 CreateWindow(ui::wm::WINDOW_TYPE_NORMAL, rect)); |
| 770 | 770 |
| 771 // The windows should be in the reverse order of creation in the MRU list. | 771 // The windows should be in the reverse order of creation in the MRU list. |
| 772 { | 772 { |
| 773 aura::Window::Windows windows = WmWindowAura::ToAuraWindows( | 773 aura::Window::Windows windows = WmWindow::ToAuraWindows( |
| 774 WmShell::Get()->mru_window_tracker()->BuildMruWindowList()); | 774 WmShell::Get()->mru_window_tracker()->BuildMruWindowList()); |
| 775 | 775 |
| 776 EXPECT_EQ(w1.get(), windows[4]); | 776 EXPECT_EQ(w1.get(), windows[4]); |
| 777 EXPECT_EQ(w2.get(), windows[3]); | 777 EXPECT_EQ(w2.get(), windows[3]); |
| 778 EXPECT_EQ(w3.get(), windows[2]); | 778 EXPECT_EQ(w3.get(), windows[2]); |
| 779 EXPECT_EQ(w4.get(), windows[1]); | 779 EXPECT_EQ(w4.get(), windows[1]); |
| 780 EXPECT_EQ(w5.get(), windows[0]); | 780 EXPECT_EQ(w5.get(), windows[0]); |
| 781 } | 781 } |
| 782 | 782 |
| 783 // Activating the window manager should keep the order. | 783 // Activating the window manager should keep the order. |
| 784 MaximizeModeWindowManager* manager = CreateMaximizeModeWindowManager(); | 784 MaximizeModeWindowManager* manager = CreateMaximizeModeWindowManager(); |
| 785 ASSERT_TRUE(manager); | 785 ASSERT_TRUE(manager); |
| 786 EXPECT_EQ(5, manager->GetNumberOfManagedWindows()); | 786 EXPECT_EQ(5, manager->GetNumberOfManagedWindows()); |
| 787 { | 787 { |
| 788 aura::Window::Windows windows = WmWindowAura::ToAuraWindows( | 788 aura::Window::Windows windows = WmWindow::ToAuraWindows( |
| 789 WmShell::Get()->mru_window_tracker()->BuildMruWindowList()); | 789 WmShell::Get()->mru_window_tracker()->BuildMruWindowList()); |
| 790 // We do not test maximization here again since that was done already. | 790 // We do not test maximization here again since that was done already. |
| 791 EXPECT_EQ(w1.get(), windows[4]); | 791 EXPECT_EQ(w1.get(), windows[4]); |
| 792 EXPECT_EQ(w2.get(), windows[3]); | 792 EXPECT_EQ(w2.get(), windows[3]); |
| 793 EXPECT_EQ(w3.get(), windows[2]); | 793 EXPECT_EQ(w3.get(), windows[2]); |
| 794 EXPECT_EQ(w4.get(), windows[1]); | 794 EXPECT_EQ(w4.get(), windows[1]); |
| 795 EXPECT_EQ(w5.get(), windows[0]); | 795 EXPECT_EQ(w5.get(), windows[0]); |
| 796 } | 796 } |
| 797 | 797 |
| 798 // Destroying should still keep the order. | 798 // Destroying should still keep the order. |
| 799 DestroyMaximizeModeWindowManager(); | 799 DestroyMaximizeModeWindowManager(); |
| 800 { | 800 { |
| 801 aura::Window::Windows windows = WmWindowAura::ToAuraWindows( | 801 aura::Window::Windows windows = WmWindow::ToAuraWindows( |
| 802 WmShell::Get()->mru_window_tracker()->BuildMruWindowList()); | 802 WmShell::Get()->mru_window_tracker()->BuildMruWindowList()); |
| 803 // We do not test maximization here again since that was done already. | 803 // We do not test maximization here again since that was done already. |
| 804 EXPECT_EQ(w1.get(), windows[4]); | 804 EXPECT_EQ(w1.get(), windows[4]); |
| 805 EXPECT_EQ(w2.get(), windows[3]); | 805 EXPECT_EQ(w2.get(), windows[3]); |
| 806 EXPECT_EQ(w3.get(), windows[2]); | 806 EXPECT_EQ(w3.get(), windows[2]); |
| 807 EXPECT_EQ(w4.get(), windows[1]); | 807 EXPECT_EQ(w4.get(), windows[1]); |
| 808 EXPECT_EQ(w5.get(), windows[0]); | 808 EXPECT_EQ(w5.get(), windows[0]); |
| 809 } | 809 } |
| 810 } | 810 } |
| 811 | 811 |
| (...skipping 890 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1702 EXPECT_EQ(1, observer.GetPostCountAndReset()); | 1702 EXPECT_EQ(1, observer.GetPostCountAndReset()); |
| 1703 EXPECT_EQ(wm::WINDOW_STATE_TYPE_MINIMIZED, | 1703 EXPECT_EQ(wm::WINDOW_STATE_TYPE_MINIMIZED, |
| 1704 observer.GetLastOldStateAndReset()); | 1704 observer.GetLastOldStateAndReset()); |
| 1705 | 1705 |
| 1706 window_state->RemoveObserver(&observer); | 1706 window_state->RemoveObserver(&observer); |
| 1707 | 1707 |
| 1708 DestroyMaximizeModeWindowManager(); | 1708 DestroyMaximizeModeWindowManager(); |
| 1709 } | 1709 } |
| 1710 | 1710 |
| 1711 } // namespace ash | 1711 } // namespace ash |
| OLD | NEW |