| 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/shelf/shelf_layout_manager.h" | 5 #include "ash/shelf/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/display/display_manager.h" | 10 #include "ash/display/display_manager.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 #include "ash/wm/window_util.h" | 28 #include "ash/wm/window_util.h" |
| 29 #include "base/command_line.h" | 29 #include "base/command_line.h" |
| 30 #include "base/strings/utf_string_conversions.h" | 30 #include "base/strings/utf_string_conversions.h" |
| 31 #include "ui/aura/client/aura_constants.h" | 31 #include "ui/aura/client/aura_constants.h" |
| 32 #include "ui/aura/client/window_tree_client.h" | 32 #include "ui/aura/client/window_tree_client.h" |
| 33 #include "ui/aura/window.h" | 33 #include "ui/aura/window.h" |
| 34 #include "ui/aura/window_event_dispatcher.h" | 34 #include "ui/aura/window_event_dispatcher.h" |
| 35 #include "ui/compositor/layer.h" | 35 #include "ui/compositor/layer.h" |
| 36 #include "ui/compositor/layer_animator.h" | 36 #include "ui/compositor/layer_animator.h" |
| 37 #include "ui/compositor/scoped_animation_duration_scale_mode.h" | 37 #include "ui/compositor/scoped_animation_duration_scale_mode.h" |
| 38 #include "ui/display/manager/display_layout.h" |
| 38 #include "ui/events/gesture_detection/gesture_configuration.h" | 39 #include "ui/events/gesture_detection/gesture_configuration.h" |
| 39 #include "ui/events/test/event_generator.h" | 40 #include "ui/events/test/event_generator.h" |
| 40 #include "ui/gfx/display.h" | 41 #include "ui/gfx/display.h" |
| 41 #include "ui/gfx/screen.h" | 42 #include "ui/gfx/screen.h" |
| 42 #include "ui/views/controls/label.h" | 43 #include "ui/views/controls/label.h" |
| 43 #include "ui/views/layout/fill_layout.h" | 44 #include "ui/views/layout/fill_layout.h" |
| 44 #include "ui/views/view.h" | 45 #include "ui/views/view.h" |
| 45 #include "ui/views/widget/widget.h" | 46 #include "ui/views/widget/widget.h" |
| 46 | 47 |
| 47 #if defined(OS_WIN) | 48 #if defined(OS_WIN) |
| (...skipping 892 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 940 } | 941 } |
| 941 | 942 |
| 942 // Test the behavior of the shelf when it is auto hidden and it is on the | 943 // Test the behavior of the shelf when it is auto hidden and it is on the |
| 943 // boundary between the primary and the secondary display. | 944 // boundary between the primary and the secondary display. |
| 944 TEST_F(ShelfLayoutManagerTest, AutoHideShelfOnScreenBoundary) { | 945 TEST_F(ShelfLayoutManagerTest, AutoHideShelfOnScreenBoundary) { |
| 945 if (!SupportsMultipleDisplays()) | 946 if (!SupportsMultipleDisplays()) |
| 946 return; | 947 return; |
| 947 | 948 |
| 948 UpdateDisplay("800x600,800x600"); | 949 UpdateDisplay("800x600,800x600"); |
| 949 Shell::GetInstance()->display_manager()->SetLayoutForCurrentDisplays( | 950 Shell::GetInstance()->display_manager()->SetLayoutForCurrentDisplays( |
| 950 test::CreateDisplayLayout(DisplayPlacement::RIGHT, 0)); | 951 test::CreateDisplayLayout(display::DisplayPlacement::RIGHT, 0)); |
| 951 // Put the primary monitor's shelf on the display boundary. | 952 // Put the primary monitor's shelf on the display boundary. |
| 952 ShelfLayoutManager* shelf = GetShelfLayoutManager(); | 953 ShelfLayoutManager* shelf = GetShelfLayoutManager(); |
| 953 shelf->SetAlignment(SHELF_ALIGNMENT_RIGHT); | 954 shelf->SetAlignment(SHELF_ALIGNMENT_RIGHT); |
| 954 | 955 |
| 955 // Create a window because the shelf is always shown when no windows are | 956 // Create a window because the shelf is always shown when no windows are |
| 956 // visible. | 957 // visible. |
| 957 CreateTestWidget(); | 958 CreateTestWidget(); |
| 958 | 959 |
| 959 aura::Window::Windows root_windows = Shell::GetAllRootWindows(); | 960 aura::Window::Windows root_windows = Shell::GetAllRootWindows(); |
| 960 ASSERT_EQ(root_windows[0], | 961 ASSERT_EQ(root_windows[0], |
| (...skipping 1369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2330 StatusAreaWidget* status_area_widget = | 2331 StatusAreaWidget* status_area_widget = |
| 2331 Shell::GetPrimaryRootWindowController()->shelf()->status_area_widget(); | 2332 Shell::GetPrimaryRootWindowController()->shelf()->status_area_widget(); |
| 2332 EXPECT_TRUE(status_area_widget->IsVisible()); | 2333 EXPECT_TRUE(status_area_widget->IsVisible()); |
| 2333 // Shelf should be in the first display's area. | 2334 // Shelf should be in the first display's area. |
| 2334 gfx::Rect status_area_bounds(status_area_widget->GetWindowBoundsInScreen()); | 2335 gfx::Rect status_area_bounds(status_area_widget->GetWindowBoundsInScreen()); |
| 2335 EXPECT_TRUE(gfx::Rect(0, 0, 500, 400).Contains(status_area_bounds)); | 2336 EXPECT_TRUE(gfx::Rect(0, 0, 500, 400).Contains(status_area_bounds)); |
| 2336 EXPECT_EQ(gfx::Point(500, 400), status_area_bounds.bottom_right()); | 2337 EXPECT_EQ(gfx::Point(500, 400), status_area_bounds.bottom_right()); |
| 2337 } | 2338 } |
| 2338 | 2339 |
| 2339 } // namespace ash | 2340 } // namespace ash |
| OLD | NEW |