| 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 "ash/shared/immersive_fullscreen_controller.h" | 5 #include "ash/shared/immersive_fullscreen_controller.h" |
| 6 | 6 |
| 7 #include "ash/common/shelf/wm_shelf.h" | 7 #include "ash/common/shelf/wm_shelf.h" |
| 8 #include "ash/common/wm/window_state.h" | 8 #include "ash/common/wm/window_state.h" |
| 9 #include "ash/display/display_manager.h" | |
| 10 #include "ash/display/mouse_cursor_event_filter.h" | 9 #include "ash/display/mouse_cursor_event_filter.h" |
| 11 #include "ash/public/cpp/shelf_types.h" | 10 #include "ash/public/cpp/shelf_types.h" |
| 12 #include "ash/root_window_controller.h" | 11 #include "ash/root_window_controller.h" |
| 13 #include "ash/shared/immersive_fullscreen_controller_delegate.h" | 12 #include "ash/shared/immersive_fullscreen_controller_delegate.h" |
| 14 #include "ash/shell.h" | 13 #include "ash/shell.h" |
| 15 #include "ash/test/ash_test_base.h" | 14 #include "ash/test/ash_test_base.h" |
| 16 #include "ash/test/display_manager_test_api.h" | |
| 17 #include "ash/test/immersive_fullscreen_controller_test_api.h" | 15 #include "ash/test/immersive_fullscreen_controller_test_api.h" |
| 18 #include "ash/wm/window_state_aura.h" | 16 #include "ash/wm/window_state_aura.h" |
| 19 #include "ui/aura/client/aura_constants.h" | 17 #include "ui/aura/client/aura_constants.h" |
| 20 #include "ui/aura/client/cursor_client.h" | 18 #include "ui/aura/client/cursor_client.h" |
| 21 #include "ui/aura/env.h" | 19 #include "ui/aura/env.h" |
| 22 #include "ui/aura/test/test_window_delegate.h" | 20 #include "ui/aura/test/test_window_delegate.h" |
| 23 #include "ui/aura/window.h" | 21 #include "ui/aura/window.h" |
| 24 #include "ui/aura/window_event_dispatcher.h" | 22 #include "ui/aura/window_event_dispatcher.h" |
| 25 #include "ui/display/manager/display_layout.h" | 23 #include "ui/display/manager/display_layout.h" |
| 24 #include "ui/display/manager/display_manager.h" |
| 25 #include "ui/display/test/display_manager_test_api.h" |
| 26 #include "ui/events/event_utils.h" | 26 #include "ui/events/event_utils.h" |
| 27 #include "ui/events/test/event_generator.h" | 27 #include "ui/events/test/event_generator.h" |
| 28 #include "ui/events/test/test_event_handler.h" | 28 #include "ui/events/test/test_event_handler.h" |
| 29 #include "ui/gfx/animation/slide_animation.h" | 29 #include "ui/gfx/animation/slide_animation.h" |
| 30 #include "ui/views/bubble/bubble_dialog_delegate.h" | 30 #include "ui/views/bubble/bubble_dialog_delegate.h" |
| 31 #include "ui/views/controls/native/native_view_host.h" | 31 #include "ui/views/controls/native/native_view_host.h" |
| 32 #include "ui/views/view.h" | 32 #include "ui/views/view.h" |
| 33 #include "ui/views/widget/widget.h" | 33 #include "ui/views/widget/widget.h" |
| 34 | 34 |
| 35 namespace ash { | 35 namespace ash { |
| (...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 495 // Test mouse event processing for top-of-screen reveal triggering when the user | 495 // Test mouse event processing for top-of-screen reveal triggering when the user |
| 496 // has a vertical display layout (primary display above/below secondary display) | 496 // has a vertical display layout (primary display above/below secondary display) |
| 497 // and the immersive fullscreen window is on the bottom display. | 497 // and the immersive fullscreen window is on the bottom display. |
| 498 TEST_F(ImmersiveFullscreenControllerTest, MouseEventsVerticalDisplayLayout) { | 498 TEST_F(ImmersiveFullscreenControllerTest, MouseEventsVerticalDisplayLayout) { |
| 499 if (!SupportsMultipleDisplays()) | 499 if (!SupportsMultipleDisplays()) |
| 500 return; | 500 return; |
| 501 | 501 |
| 502 // Set up initial state. | 502 // Set up initial state. |
| 503 UpdateDisplay("800x600,800x600"); | 503 UpdateDisplay("800x600,800x600"); |
| 504 ash::Shell::GetInstance()->display_manager()->SetLayoutForCurrentDisplays( | 504 ash::Shell::GetInstance()->display_manager()->SetLayoutForCurrentDisplays( |
| 505 test::CreateDisplayLayout(display_manager(), | 505 display::test::CreateDisplayLayout(display_manager(), |
| 506 display::DisplayPlacement::TOP, 0)); | 506 display::DisplayPlacement::TOP, 0)); |
| 507 | 507 |
| 508 SetEnabled(true); | 508 SetEnabled(true); |
| 509 ASSERT_TRUE(controller()->IsEnabled()); | 509 ASSERT_TRUE(controller()->IsEnabled()); |
| 510 ASSERT_FALSE(controller()->IsRevealed()); | 510 ASSERT_FALSE(controller()->IsRevealed()); |
| 511 | 511 |
| 512 aura::Window::Windows root_windows = ash::Shell::GetAllRootWindows(); | 512 aura::Window::Windows root_windows = ash::Shell::GetAllRootWindows(); |
| 513 ASSERT_EQ(root_windows[0], | 513 ASSERT_EQ(root_windows[0], |
| 514 top_container()->GetWidget()->GetNativeWindow()->GetRootWindow()); | 514 top_container()->GetWidget()->GetNativeWindow()->GetRootWindow()); |
| 515 | 515 |
| 516 gfx::Rect primary_root_window_bounds_in_screen = | 516 gfx::Rect primary_root_window_bounds_in_screen = |
| (...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1049 SetEnabled(true); | 1049 SetEnabled(true); |
| 1050 EXPECT_EQ(SHELF_AUTO_HIDE, shelf->GetVisibilityState()); | 1050 EXPECT_EQ(SHELF_AUTO_HIDE, shelf->GetVisibilityState()); |
| 1051 | 1051 |
| 1052 // Disabling immersive fullscreen maintains the user's auto-hide selection. | 1052 // Disabling immersive fullscreen maintains the user's auto-hide selection. |
| 1053 SetEnabled(false); | 1053 SetEnabled(false); |
| 1054 window()->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL); | 1054 window()->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL); |
| 1055 EXPECT_EQ(SHELF_AUTO_HIDE, shelf->GetVisibilityState()); | 1055 EXPECT_EQ(SHELF_AUTO_HIDE, shelf->GetVisibilityState()); |
| 1056 } | 1056 } |
| 1057 | 1057 |
| 1058 } // namespase ash | 1058 } // namespase ash |
| OLD | NEW |