| 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/display/window_tree_host_manager.h" | 5 #include "ash/display/window_tree_host_manager.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "ash/aura/wm_window_aura.h" | 9 #include "ash/aura/wm_window_aura.h" |
| 10 #include "ash/common/ash_switches.h" | 10 #include "ash/common/ash_switches.h" |
| 11 #include "ash/common/display/display_info.h" | 11 #include "ash/common/display/display_info.h" |
| 12 #include "ash/common/material_design/material_design_controller.h" | 12 #include "ash/common/material_design/material_design_controller.h" |
| 13 #include "ash/common/wm/window_state.h" | 13 #include "ash/common/wm/window_state.h" |
| 14 #include "ash/common/wm/wm_event.h" | 14 #include "ash/common/wm/wm_event.h" |
| 15 #include "ash/common/wm/wm_screen_util.h" | 15 #include "ash/common/wm/wm_screen_util.h" |
| 16 #include "ash/display/display_layout_store.h" | |
| 17 #include "ash/display/display_manager.h" | 16 #include "ash/display/display_manager.h" |
| 18 #include "ash/display/display_util.h" | 17 #include "ash/display/display_util.h" |
| 19 #include "ash/screen_util.h" | 18 #include "ash/screen_util.h" |
| 20 #include "ash/shelf/shelf.h" | 19 #include "ash/shelf/shelf.h" |
| 21 #include "ash/shelf/shelf_widget.h" | 20 #include "ash/shelf/shelf_widget.h" |
| 22 #include "ash/shell.h" | 21 #include "ash/shell.h" |
| 23 #include "ash/test/ash_md_test_base.h" | 22 #include "ash/test/ash_md_test_base.h" |
| 24 #include "ash/test/ash_test_base.h" | 23 #include "ash/test/ash_test_base.h" |
| 25 #include "ash/test/ash_test_helper.h" | 24 #include "ash/test/ash_test_helper.h" |
| 26 #include "ash/test/cursor_manager_test_api.h" | 25 #include "ash/test/cursor_manager_test_api.h" |
| 27 #include "ash/test/display_manager_test_api.h" | 26 #include "ash/test/display_manager_test_api.h" |
| 28 #include "ash/test/test_shell_delegate.h" | 27 #include "ash/test/test_shell_delegate.h" |
| 29 #include "ash/wm/window_state_aura.h" | 28 #include "ash/wm/window_state_aura.h" |
| 30 #include "base/command_line.h" | 29 #include "base/command_line.h" |
| 31 #include "ui/aura/client/focus_change_observer.h" | 30 #include "ui/aura/client/focus_change_observer.h" |
| 32 #include "ui/aura/client/focus_client.h" | 31 #include "ui/aura/client/focus_client.h" |
| 33 #include "ui/aura/env.h" | 32 #include "ui/aura/env.h" |
| 34 #include "ui/aura/window_observer.h" | 33 #include "ui/aura/window_observer.h" |
| 35 #include "ui/aura/window_tracker.h" | 34 #include "ui/aura/window_tracker.h" |
| 36 #include "ui/aura/window_tree_host.h" | 35 #include "ui/aura/window_tree_host.h" |
| 37 #include "ui/display/display.h" | 36 #include "ui/display/display.h" |
| 38 #include "ui/display/display_observer.h" | 37 #include "ui/display/display_observer.h" |
| 39 #include "ui/display/manager/display_layout.h" | 38 #include "ui/display/manager/display_layout.h" |
| 39 #include "ui/display/manager/display_layout_store.h" |
| 40 #include "ui/display/screen.h" | 40 #include "ui/display/screen.h" |
| 41 #include "ui/events/event_handler.h" | 41 #include "ui/events/event_handler.h" |
| 42 #include "ui/events/test/event_generator.h" | 42 #include "ui/events/test/event_generator.h" |
| 43 #include "ui/views/mouse_watcher.h" | 43 #include "ui/views/mouse_watcher.h" |
| 44 #include "ui/views/mouse_watcher_view_host.h" | 44 #include "ui/views/mouse_watcher_view_host.h" |
| 45 #include "ui/views/view.h" | 45 #include "ui/views/view.h" |
| 46 #include "ui/views/widget/widget.h" | 46 #include "ui/views/widget/widget.h" |
| 47 #include "ui/wm/public/activation_change_observer.h" | 47 #include "ui/wm/public/activation_change_observer.h" |
| 48 #include "ui/wm/public/activation_client.h" | 48 #include "ui/wm/public/activation_client.h" |
| 49 | 49 |
| (...skipping 1345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1395 UpdateDisplay("300x280,200x200"); | 1395 UpdateDisplay("300x280,200x200"); |
| 1396 EXPECT_EQ("450,10", env->last_mouse_location().ToString()); | 1396 EXPECT_EQ("450,10", env->last_mouse_location().ToString()); |
| 1397 } | 1397 } |
| 1398 | 1398 |
| 1399 TEST_P(WindowTreeHostManagerTest, | 1399 TEST_P(WindowTreeHostManagerTest, |
| 1400 UpdateMouseLocationAfterDisplayChange_2ndOnLeft) { | 1400 UpdateMouseLocationAfterDisplayChange_2ndOnLeft) { |
| 1401 if (!SupportsMultipleDisplays()) | 1401 if (!SupportsMultipleDisplays()) |
| 1402 return; | 1402 return; |
| 1403 | 1403 |
| 1404 // Set the 2nd display on the left. | 1404 // Set the 2nd display on the left. |
| 1405 DisplayLayoutStore* layout_store = | 1405 display::DisplayLayoutStore* layout_store = |
| 1406 Shell::GetInstance()->display_manager()->layout_store(); | 1406 Shell::GetInstance()->display_manager()->layout_store(); |
| 1407 display::DisplayPlacement new_default(display::DisplayPlacement::LEFT, 0); | 1407 display::DisplayPlacement new_default(display::DisplayPlacement::LEFT, 0); |
| 1408 layout_store->SetDefaultDisplayPlacement(new_default); | 1408 layout_store->SetDefaultDisplayPlacement(new_default); |
| 1409 | 1409 |
| 1410 UpdateDisplay("200x200,300x300"); | 1410 UpdateDisplay("200x200,300x300"); |
| 1411 aura::Window::Windows root_windows = Shell::GetAllRootWindows(); | 1411 aura::Window::Windows root_windows = Shell::GetAllRootWindows(); |
| 1412 | 1412 |
| 1413 EXPECT_EQ("-300,0 300x300", | 1413 EXPECT_EQ("-300,0 300x300", |
| 1414 ScreenUtil::GetSecondaryDisplay().bounds().ToString()); | 1414 ScreenUtil::GetSecondaryDisplay().bounds().ToString()); |
| 1415 | 1415 |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1527 widget->GetNativeWindow()->GetRootWindow()); | 1527 widget->GetNativeWindow()->GetRootWindow()); |
| 1528 event_generator.MoveMouseToCenterOf(widget->GetNativeWindow()); | 1528 event_generator.MoveMouseToCenterOf(widget->GetNativeWindow()); |
| 1529 | 1529 |
| 1530 UpdateDisplay("300x300"); | 1530 UpdateDisplay("300x300"); |
| 1531 watcher.Stop(); | 1531 watcher.Stop(); |
| 1532 | 1532 |
| 1533 widget->CloseNow(); | 1533 widget->CloseNow(); |
| 1534 } | 1534 } |
| 1535 | 1535 |
| 1536 } // namespace ash | 1536 } // namespace ash |
| OLD | NEW |