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 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
433 // Widget is now owned by the parent window. | 433 // Widget is now owned by the parent window. |
434 widget->Init(params); | 434 widget->Init(params); |
435 widget->Show(); | 435 widget->Show(); |
436 aura::Window* window = widget->GetNativeWindow(); | 436 aura::Window* window = widget->GetNativeWindow(); |
437 gfx::Rect display_bounds( | 437 gfx::Rect display_bounds( |
438 gfx::Screen::GetDisplayNearestWindow(window).bounds()); | 438 gfx::Screen::GetDisplayNearestWindow(window).bounds()); |
439 | 439 |
440 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); | 440 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); |
441 EXPECT_EQ(ShelfLayoutManager::AUTO_HIDE, shelf->visibility_state()); | 441 EXPECT_EQ(ShelfLayoutManager::AUTO_HIDE, shelf->visibility_state()); |
442 EXPECT_EQ(display_bounds.bottom() - ShelfLayoutManager::kAutoHideSize, | 442 EXPECT_EQ(display_bounds.bottom() - ShelfLayoutManager::kAutoHideSize, |
443 shelf->GetMaximizedWindowBounds(window).bottom()); | 443 shelf->GetWorkAreaBounds(window).bottom()); |
444 | 444 |
445 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER); | 445 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER); |
446 EXPECT_EQ(ShelfLayoutManager::VISIBLE, shelf->visibility_state()); | 446 EXPECT_EQ(ShelfLayoutManager::VISIBLE, shelf->visibility_state()); |
447 EXPECT_GT(display_bounds.bottom() - ShelfLayoutManager::kAutoHideSize, | 447 EXPECT_GT(display_bounds.bottom() - ShelfLayoutManager::kAutoHideSize, |
448 shelf->GetMaximizedWindowBounds(window).bottom()); | 448 shelf->GetWorkAreaBounds(window).bottom()); |
449 | 449 |
450 widget->Maximize(); | 450 widget->Maximize(); |
451 EXPECT_EQ(ShelfLayoutManager::VISIBLE, shelf->visibility_state()); | 451 EXPECT_EQ(ShelfLayoutManager::VISIBLE, shelf->visibility_state()); |
452 EXPECT_EQ(gfx::Screen::GetDisplayNearestWindow(window).work_area().bottom(), | 452 EXPECT_EQ(gfx::Screen::GetDisplayNearestWindow(window).work_area().bottom(), |
453 widget->GetWorkAreaBoundsInScreen().bottom()); | 453 widget->GetWorkAreaBoundsInScreen().bottom()); |
454 | 454 |
455 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); | 455 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); |
456 EXPECT_EQ(ShelfLayoutManager::AUTO_HIDE, shelf->visibility_state()); | 456 EXPECT_EQ(ShelfLayoutManager::AUTO_HIDE, shelf->visibility_state()); |
457 EXPECT_EQ(gfx::Screen::GetDisplayNearestWindow(window).work_area().bottom(), | 457 EXPECT_EQ(gfx::Screen::GetDisplayNearestWindow(window).work_area().bottom(), |
458 widget->GetWorkAreaBoundsInScreen().bottom()); | 458 widget->GetWorkAreaBoundsInScreen().bottom()); |
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
949 EXPECT_TRUE(status_area->IsMessageBubbleShown()); | 949 EXPECT_TRUE(status_area->IsMessageBubbleShown()); |
950 } else { | 950 } else { |
951 EXPECT_FALSE(shelf->IsVisible()); | 951 EXPECT_FALSE(shelf->IsVisible()); |
952 EXPECT_FALSE(status_area->IsMessageBubbleShown()); | 952 EXPECT_FALSE(status_area->IsMessageBubbleShown()); |
953 } | 953 } |
954 } | 954 } |
955 } | 955 } |
956 | 956 |
957 } // namespace internal | 957 } // namespace internal |
958 } // namespace ash | 958 } // namespace ash |
OLD | NEW |