| 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/common/ash_switches.h" | 9 #include "ash/common/ash_switches.h" |
| 10 #include "ash/common/shelf/wm_shelf.h" | 10 #include "ash/common/shelf/wm_shelf.h" |
| (...skipping 1581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1592 EXPECT_EQ(0, manager->GetNumberOfManagedWindows()); | 1592 EXPECT_EQ(0, manager->GetNumberOfManagedWindows()); |
| 1593 } | 1593 } |
| 1594 | 1594 |
| 1595 // Tests that windows that can control maximized bounds are not maximized | 1595 // Tests that windows that can control maximized bounds are not maximized |
| 1596 // and not tracked. | 1596 // and not tracked. |
| 1597 TEST_F(MaximizeModeWindowManagerTest, DontMaximizeClientManagedWindows) { | 1597 TEST_F(MaximizeModeWindowManagerTest, DontMaximizeClientManagedWindows) { |
| 1598 gfx::Rect rect(10, 10, 200, 50); | 1598 gfx::Rect rect(10, 10, 200, 50); |
| 1599 std::unique_ptr<aura::Window> window( | 1599 std::unique_ptr<aura::Window> window( |
| 1600 CreateWindow(ui::wm::WINDOW_TYPE_NORMAL, rect)); | 1600 CreateWindow(ui::wm::WINDOW_TYPE_NORMAL, rect)); |
| 1601 | 1601 |
| 1602 wm::GetWindowState(window.get())->set_allow_set_bounds_in_maximized(true); | 1602 wm::GetWindowState(window.get())->set_allow_set_bounds_direct(true); |
| 1603 | 1603 |
| 1604 MaximizeModeWindowManager* manager = CreateMaximizeModeWindowManager(); | 1604 MaximizeModeWindowManager* manager = CreateMaximizeModeWindowManager(); |
| 1605 EXPECT_FALSE(wm::GetWindowState(window.get())->IsMaximized()); | 1605 EXPECT_FALSE(wm::GetWindowState(window.get())->IsMaximized()); |
| 1606 EXPECT_EQ(0, manager->GetNumberOfManagedWindows()); | 1606 EXPECT_EQ(0, manager->GetNumberOfManagedWindows()); |
| 1607 } | 1607 } |
| 1608 | 1608 |
| 1609 namespace { | 1609 namespace { |
| 1610 | 1610 |
| 1611 class TestObserver : public wm::WindowStateObserver { | 1611 class TestObserver : public wm::WindowStateObserver { |
| 1612 public: | 1612 public: |
| (...skipping 89 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 |