| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "ash/wm/common/panels/panel_window_resizer.h" | 5 #include "ash/wm/common/panels/panel_window_resizer.h" |
| 6 | 6 |
| 7 #include "ash/root_window_controller.h" | 7 #include "ash/root_window_controller.h" |
| 8 #include "ash/shelf/shelf.h" | 8 #include "ash/shelf/shelf.h" |
| 9 #include "ash/shelf/shelf_layout_manager.h" | 9 #include "ash/shelf/shelf_layout_manager.h" |
| 10 #include "ash/shelf/shelf_model.h" | 10 #include "ash/shelf/shelf_model.h" |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 std::unique_ptr<aura::Window> window(CreatePanelWindow(gfx::Point(0, 0))); | 261 std::unique_ptr<aura::Window> window(CreatePanelWindow(gfx::Point(0, 0))); |
| 262 wm::WindowState* state = wm::GetWindowState(window.get()); | 262 wm::WindowState* state = wm::GetWindowState(window.get()); |
| 263 gfx::Rect expected_bounds = window->GetBoundsInScreen(); | 263 gfx::Rect expected_bounds = window->GetBoundsInScreen(); |
| 264 expected_bounds.set_y(expected_bounds.y() - 100); | 264 expected_bounds.set_y(expected_bounds.y() - 100); |
| 265 DragStart(window.get()); | 265 DragStart(window.get()); |
| 266 DragMove(0, -100); | 266 DragMove(0, -100); |
| 267 EXPECT_FALSE(state->IsMinimized()); | 267 EXPECT_FALSE(state->IsMinimized()); |
| 268 | 268 |
| 269 // Hide the shelf. This minimizes all attached windows but should ignore | 269 // Hide the shelf. This minimizes all attached windows but should ignore |
| 270 // the dragged window. | 270 // the dragged window. |
| 271 ShelfLayoutManager* layout_manager = | 271 Shelf* shelf = RootWindowController::ForWindow(window.get())->GetShelf(); |
| 272 RootWindowController::ForWindow(window.get()) | 272 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_ALWAYS_HIDDEN); |
| 273 ->shelf_widget() | 273 shelf->shelf_layout_manager()->UpdateVisibilityState(); |
| 274 ->shelf_layout_manager(); | |
| 275 layout_manager->SetAutoHideBehavior(SHELF_AUTO_HIDE_ALWAYS_HIDDEN); | |
| 276 layout_manager->UpdateVisibilityState(); | |
| 277 RunAllPendingInMessageLoop(); | 274 RunAllPendingInMessageLoop(); |
| 278 EXPECT_FALSE(state->IsMinimized()); | 275 EXPECT_FALSE(state->IsMinimized()); |
| 279 EXPECT_EQ(kShellWindowId_PanelContainer, window->parent()->id()); | 276 EXPECT_EQ(kShellWindowId_PanelContainer, window->parent()->id()); |
| 280 DragEnd(); | 277 DragEnd(); |
| 281 | 278 |
| 282 // When the drag ends the window should be detached and placed where it was | 279 // When the drag ends the window should be detached and placed where it was |
| 283 // dragged to. | 280 // dragged to. |
| 284 EXPECT_EQ(kShellWindowId_DefaultContainer, window->parent()->id()); | 281 EXPECT_EQ(kShellWindowId_DefaultContainer, window->parent()->id()); |
| 285 EXPECT_FALSE(state->IsMinimized()); | 282 EXPECT_FALSE(state->IsMinimized()); |
| 286 EXPECT_EQ(expected_bounds.ToString(), window->GetBoundsInScreen().ToString()); | 283 EXPECT_EQ(expected_bounds.ToString(), window->GetBoundsInScreen().ToString()); |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 560 | 557 |
| 561 INSTANTIATE_TEST_CASE_P(LtrRtl, PanelWindowResizerTextDirectionTest, | 558 INSTANTIATE_TEST_CASE_P(LtrRtl, PanelWindowResizerTextDirectionTest, |
| 562 testing::Bool()); | 559 testing::Bool()); |
| 563 INSTANTIATE_TEST_CASE_P(NormalPanelPopup, | 560 INSTANTIATE_TEST_CASE_P(NormalPanelPopup, |
| 564 PanelWindowResizerTransientTest, | 561 PanelWindowResizerTransientTest, |
| 565 testing::Values(ui::wm::WINDOW_TYPE_NORMAL, | 562 testing::Values(ui::wm::WINDOW_TYPE_NORMAL, |
| 566 ui::wm::WINDOW_TYPE_PANEL, | 563 ui::wm::WINDOW_TYPE_PANEL, |
| 567 ui::wm::WINDOW_TYPE_POPUP)); | 564 ui::wm::WINDOW_TYPE_POPUP)); |
| 568 | 565 |
| 569 } // namespace ash | 566 } // namespace ash |
| OLD | NEW |