| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/shelf_layout_manager.h" | 5 #include "ash/wm/shelf_layout_manager.h" |
| 6 | 6 |
| 7 #include "ash/accelerators/accelerator_controller.h" | 7 #include "ash/accelerators/accelerator_controller.h" |
| 8 #include "ash/accelerators/accelerator_table.h" | 8 #include "ash/accelerators/accelerator_table.h" |
| 9 #include "ash/ash_switches.h" | 9 #include "ash/ash_switches.h" |
| 10 #include "ash/focus_cycler.h" | 10 #include "ash/focus_cycler.h" |
| (...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 434 params.bounds = gfx::Rect(0, 0, 200, 200); | 434 params.bounds = gfx::Rect(0, 0, 200, 200); |
| 435 // Widget is now owned by the parent window. | 435 // Widget is now owned by the parent window. |
| 436 widget->Init(params); | 436 widget->Init(params); |
| 437 widget->Show(); | 437 widget->Show(); |
| 438 aura::Window* window = widget->GetNativeWindow(); | 438 aura::Window* window = widget->GetNativeWindow(); |
| 439 gfx::Rect display_bounds( | 439 gfx::Rect display_bounds( |
| 440 Shell::GetScreen()->GetDisplayNearestWindow(window).bounds()); | 440 Shell::GetScreen()->GetDisplayNearestWindow(window).bounds()); |
| 441 | 441 |
| 442 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); | 442 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); |
| 443 EXPECT_EQ(ShelfLayoutManager::AUTO_HIDE, shelf->visibility_state()); | 443 EXPECT_EQ(ShelfLayoutManager::AUTO_HIDE, shelf->visibility_state()); |
| 444 EXPECT_EQ(display_bounds.bottom() - ShelfLayoutManager::kAutoHideSize, | |
| 445 shelf->GetMaximizedWindowBounds(window).bottom()); | |
| 446 | 444 |
| 447 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER); | 445 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER); |
| 448 EXPECT_EQ(ShelfLayoutManager::VISIBLE, shelf->visibility_state()); | 446 EXPECT_EQ(ShelfLayoutManager::VISIBLE, shelf->visibility_state()); |
| 449 EXPECT_GT(display_bounds.bottom() - ShelfLayoutManager::kAutoHideSize, | |
| 450 shelf->GetMaximizedWindowBounds(window).bottom()); | |
| 451 | 447 |
| 452 widget->Maximize(); | 448 widget->Maximize(); |
| 453 EXPECT_EQ(ShelfLayoutManager::VISIBLE, shelf->visibility_state()); | 449 EXPECT_EQ(ShelfLayoutManager::VISIBLE, shelf->visibility_state()); |
| 454 EXPECT_EQ(Shell::GetScreen()->GetDisplayNearestWindow( | 450 EXPECT_EQ(Shell::GetScreen()->GetDisplayNearestWindow( |
| 455 window).work_area().bottom(), | 451 window).work_area().bottom(), |
| 456 widget->GetWorkAreaBoundsInScreen().bottom()); | 452 widget->GetWorkAreaBoundsInScreen().bottom()); |
| 457 | 453 |
| 458 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); | 454 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); |
| 459 EXPECT_EQ(ShelfLayoutManager::AUTO_HIDE, shelf->visibility_state()); | 455 EXPECT_EQ(ShelfLayoutManager::AUTO_HIDE, shelf->visibility_state()); |
| 460 EXPECT_EQ(Shell::GetScreen()->GetDisplayNearestWindow( | 456 EXPECT_EQ(Shell::GetScreen()->GetDisplayNearestWindow( |
| (...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 954 EXPECT_TRUE(status_area->IsMessageBubbleShown()); | 950 EXPECT_TRUE(status_area->IsMessageBubbleShown()); |
| 955 } else { | 951 } else { |
| 956 EXPECT_FALSE(shelf->IsVisible()); | 952 EXPECT_FALSE(shelf->IsVisible()); |
| 957 EXPECT_FALSE(status_area->IsMessageBubbleShown()); | 953 EXPECT_FALSE(status_area->IsMessageBubbleShown()); |
| 958 } | 954 } |
| 959 } | 955 } |
| 960 } | 956 } |
| 961 | 957 |
| 962 } // namespace internal | 958 } // namespace internal |
| 963 } // namespace ash | 959 } // namespace ash |
| OLD | NEW |