| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <algorithm> | 5 #include <algorithm> |
| 6 #include <vector> | 6 #include <vector> |
| 7 | 7 |
| 8 #include "ash/aura/wm_window_aura.h" | 8 #include "ash/aura/wm_window_aura.h" |
| 9 #include "ash/common/accessibility_delegate.h" | 9 #include "ash/common/accessibility_delegate.h" |
| 10 #include "ash/common/accessibility_types.h" | 10 #include "ash/common/accessibility_types.h" |
| (...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 626 EXPECT_EQ(wm::WINDOW_STATE_TYPE_DOCKED, | 626 EXPECT_EQ(wm::WINDOW_STATE_TYPE_DOCKED, |
| 627 wm::GetWindowState(docked1.get())->GetStateType()); | 627 wm::GetWindowState(docked1.get())->GetStateType()); |
| 628 EXPECT_EQ(wm::WINDOW_STATE_TYPE_DOCKED_MINIMIZED, | 628 EXPECT_EQ(wm::WINDOW_STATE_TYPE_DOCKED_MINIMIZED, |
| 629 wm::GetWindowState(docked2.get())->GetStateType()); | 629 wm::GetWindowState(docked2.get())->GetStateType()); |
| 630 | 630 |
| 631 ToggleOverview(); | 631 ToggleOverview(); |
| 632 | 632 |
| 633 EXPECT_FALSE(WindowsOverlapping(window1.get(), window2.get())); | 633 EXPECT_FALSE(WindowsOverlapping(window1.get(), window2.get())); |
| 634 | 634 |
| 635 gfx::Rect container_bounds = docked1->parent()->bounds(); | 635 gfx::Rect container_bounds = docked1->parent()->bounds(); |
| 636 ShelfWidget* shelf = Shell::GetPrimaryRootWindowController()->shelf_widget(); | 636 ShelfWidget* shelf = GetPrimaryShelf()->shelf_widget(); |
| 637 DockedWindowLayoutManager* manager = | 637 DockedWindowLayoutManager* manager = |
| 638 DockedWindowLayoutManager::Get(WmWindowAura::Get(docked1.get())); | 638 DockedWindowLayoutManager::Get(WmWindowAura::Get(docked1.get())); |
| 639 | 639 |
| 640 if (ash::MaterialDesignController::IsOverviewMaterial()) { | 640 if (ash::MaterialDesignController::IsOverviewMaterial()) { |
| 641 // Docked windows get shown and transformed. | 641 // Docked windows get shown and transformed. |
| 642 EXPECT_TRUE(docked2->IsVisible()); | 642 EXPECT_TRUE(docked2->IsVisible()); |
| 643 | 643 |
| 644 // Docked area shrinks. | 644 // Docked area shrinks. |
| 645 DockedWindowLayoutManager* manager = | 645 DockedWindowLayoutManager* manager = |
| 646 DockedWindowLayoutManager::Get(WmWindowAura::Get(docked1.get())); | 646 DockedWindowLayoutManager::Get(WmWindowAura::Get(docked1.get())); |
| (...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1167 EXPECT_TRUE(wm::GetWindowState(window1.get())->IsFullscreen()); | 1167 EXPECT_TRUE(wm::GetWindowState(window1.get())->IsFullscreen()); |
| 1168 } | 1168 } |
| 1169 | 1169 |
| 1170 // Tests that the shelf dimming state is removed while in overview and restored | 1170 // Tests that the shelf dimming state is removed while in overview and restored |
| 1171 // on exiting overview. | 1171 // on exiting overview. |
| 1172 TEST_P(WindowSelectorTest, OverviewUndimsShelf) { | 1172 TEST_P(WindowSelectorTest, OverviewUndimsShelf) { |
| 1173 gfx::Rect bounds(0, 0, 400, 400); | 1173 gfx::Rect bounds(0, 0, 400, 400); |
| 1174 std::unique_ptr<aura::Window> window1(CreateWindow(bounds)); | 1174 std::unique_ptr<aura::Window> window1(CreateWindow(bounds)); |
| 1175 wm::WindowState* window_state = wm::GetWindowState(window1.get()); | 1175 wm::WindowState* window_state = wm::GetWindowState(window1.get()); |
| 1176 window_state->Maximize(); | 1176 window_state->Maximize(); |
| 1177 ShelfWidget* shelf = Shell::GetPrimaryRootWindowController()->shelf_widget(); | 1177 ShelfWidget* shelf = GetPrimaryShelf()->shelf_widget(); |
| 1178 EXPECT_TRUE(shelf->GetDimsShelf()); | 1178 EXPECT_TRUE(shelf->GetDimsShelf()); |
| 1179 ToggleOverview(); | 1179 ToggleOverview(); |
| 1180 EXPECT_FALSE(shelf->GetDimsShelf()); | 1180 EXPECT_FALSE(shelf->GetDimsShelf()); |
| 1181 ToggleOverview(); | 1181 ToggleOverview(); |
| 1182 EXPECT_TRUE(shelf->GetDimsShelf()); | 1182 EXPECT_TRUE(shelf->GetDimsShelf()); |
| 1183 } | 1183 } |
| 1184 | 1184 |
| 1185 // Tests that entering overview when a fullscreen window is active in maximized | 1185 // Tests that entering overview when a fullscreen window is active in maximized |
| 1186 // mode correctly applies the transformations to the window and correctly | 1186 // mode correctly applies the transformations to the window and correctly |
| 1187 // updates the window bounds on exiting overview mode: http://crbug.com/401664. | 1187 // updates the window bounds on exiting overview mode: http://crbug.com/401664. |
| (...skipping 931 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2119 bounds.y()); | 2119 bounds.y()); |
| 2120 EXPECT_LE(transformed_rect.bottom(), bounds.bottom()); | 2120 EXPECT_LE(transformed_rect.bottom(), bounds.bottom()); |
| 2121 EXPECT_NEAR(transformed_rect.x() - bounds.x(), | 2121 EXPECT_NEAR(transformed_rect.x() - bounds.x(), |
| 2122 bounds.right() - transformed_rect.right(), 1); | 2122 bounds.right() - transformed_rect.right(), 1); |
| 2123 EXPECT_NEAR( | 2123 EXPECT_NEAR( |
| 2124 transformed_rect.y() + (int)(scale * inset) - header_height - bounds.y(), | 2124 transformed_rect.y() + (int)(scale * inset) - header_height - bounds.y(), |
| 2125 bounds.bottom() - transformed_rect.bottom(), 1); | 2125 bounds.bottom() - transformed_rect.bottom(), 1); |
| 2126 } | 2126 } |
| 2127 | 2127 |
| 2128 } // namespace ash | 2128 } // namespace ash |
| OLD | NEW |