| 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 1576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1587 EXPECT_TRUE(wm::GetWindowState(w2.get())->can_be_dragged()); | 1587 EXPECT_TRUE(wm::GetWindowState(w2.get())->can_be_dragged()); |
| 1588 } | 1588 } |
| 1589 | 1589 |
| 1590 // Tests that windows that can control maximized bounds are not maximized | 1590 // Tests that windows that can control maximized bounds are not maximized |
| 1591 // and not tracked. | 1591 // and not tracked. |
| 1592 TEST_F(MaximizeModeWindowManagerTest, DontMaximizeClientManagedWindows) { | 1592 TEST_F(MaximizeModeWindowManagerTest, DontMaximizeClientManagedWindows) { |
| 1593 gfx::Rect rect(10, 10, 200, 50); | 1593 gfx::Rect rect(10, 10, 200, 50); |
| 1594 std::unique_ptr<aura::Window> window( | 1594 std::unique_ptr<aura::Window> window( |
| 1595 CreateWindow(ui::wm::WINDOW_TYPE_NORMAL, rect)); | 1595 CreateWindow(ui::wm::WINDOW_TYPE_NORMAL, rect)); |
| 1596 | 1596 |
| 1597 wm::GetWindowState(window.get())->set_allow_set_bounds_in_maximized(true); | 1597 wm::GetWindowState(window.get())->set_allow_set_bounds_direct(true); |
| 1598 | 1598 |
| 1599 MaximizeModeWindowManager* manager = CreateMaximizeModeWindowManager(); | 1599 MaximizeModeWindowManager* manager = CreateMaximizeModeWindowManager(); |
| 1600 EXPECT_FALSE(wm::GetWindowState(window.get())->IsMaximized()); | 1600 EXPECT_FALSE(wm::GetWindowState(window.get())->IsMaximized()); |
| 1601 EXPECT_EQ(0, manager->GetNumberOfManagedWindows()); | 1601 EXPECT_EQ(0, manager->GetNumberOfManagedWindows()); |
| 1602 } | 1602 } |
| 1603 | 1603 |
| 1604 namespace { | 1604 namespace { |
| 1605 | 1605 |
| 1606 class TestObserver : public wm::WindowStateObserver { | 1606 class TestObserver : public wm::WindowStateObserver { |
| 1607 public: | 1607 public: |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1697 EXPECT_EQ(1, observer.GetPostCountAndReset()); | 1697 EXPECT_EQ(1, observer.GetPostCountAndReset()); |
| 1698 EXPECT_EQ(wm::WINDOW_STATE_TYPE_MINIMIZED, | 1698 EXPECT_EQ(wm::WINDOW_STATE_TYPE_MINIMIZED, |
| 1699 observer.GetLastOldStateAndReset()); | 1699 observer.GetLastOldStateAndReset()); |
| 1700 | 1700 |
| 1701 window_state->RemoveObserver(&observer); | 1701 window_state->RemoveObserver(&observer); |
| 1702 | 1702 |
| 1703 DestroyMaximizeModeWindowManager(); | 1703 DestroyMaximizeModeWindowManager(); |
| 1704 } | 1704 } |
| 1705 | 1705 |
| 1706 } // namespace ash | 1706 } // namespace ash |
| OLD | NEW |