| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <memory> | 10 #include <memory> |
| 11 #include <utility> | 11 #include <utility> |
| 12 | 12 |
| 13 #include "ash/common/ash_switches.h" | 13 #include "ash/common/ash_switches.h" |
| 14 #include "ash/common/system/tray/system_tray.h" | 14 #include "ash/common/system/tray/system_tray.h" |
| 15 #include "ash/display/cursor_window_controller.h" | 15 #include "ash/display/cursor_window_controller.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/mirror_window_controller.h" | 17 #include "ash/display/mirror_window_controller.h" |
| 19 #include "ash/display/root_window_transformers.h" | 18 #include "ash/display/root_window_transformers.h" |
| 20 #include "ash/host/ash_window_tree_host.h" | 19 #include "ash/host/ash_window_tree_host.h" |
| 21 #include "ash/host/ash_window_tree_host_init_params.h" | 20 #include "ash/host/ash_window_tree_host_init_params.h" |
| 22 #include "ash/host/root_window_transformer.h" | 21 #include "ash/host/root_window_transformer.h" |
| 23 #include "ash/ime/input_method_event_handler.h" | 22 #include "ash/ime/input_method_event_handler.h" |
| 24 #include "ash/magnifier/magnification_controller.h" | 23 #include "ash/magnifier/magnification_controller.h" |
| 25 #include "ash/magnifier/partial_magnification_controller.h" | 24 #include "ash/magnifier/partial_magnification_controller.h" |
| 26 #include "ash/root_window_controller.h" | 25 #include "ash/root_window_controller.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 38 #include "ui/aura/client/screen_position_client.h" | 37 #include "ui/aura/client/screen_position_client.h" |
| 39 #include "ui/aura/window.h" | 38 #include "ui/aura/window.h" |
| 40 #include "ui/aura/window_event_dispatcher.h" | 39 #include "ui/aura/window_event_dispatcher.h" |
| 41 #include "ui/aura/window_property.h" | 40 #include "ui/aura/window_property.h" |
| 42 #include "ui/aura/window_tracker.h" | 41 #include "ui/aura/window_tracker.h" |
| 43 #include "ui/aura/window_tree_host.h" | 42 #include "ui/aura/window_tree_host.h" |
| 44 #include "ui/base/ime/input_method_factory.h" | 43 #include "ui/base/ime/input_method_factory.h" |
| 45 #include "ui/compositor/compositor.h" | 44 #include "ui/compositor/compositor.h" |
| 46 #include "ui/display/display.h" | 45 #include "ui/display/display.h" |
| 47 #include "ui/display/manager/display_layout.h" | 46 #include "ui/display/manager/display_layout.h" |
| 47 #include "ui/display/manager/display_layout_store.h" |
| 48 #include "ui/display/screen.h" | 48 #include "ui/display/screen.h" |
| 49 #include "ui/wm/core/coordinate_conversion.h" | 49 #include "ui/wm/core/coordinate_conversion.h" |
| 50 #include "ui/wm/public/activation_client.h" | 50 #include "ui/wm/public/activation_client.h" |
| 51 | 51 |
| 52 #if defined(USE_X11) | 52 #if defined(USE_X11) |
| 53 #include "ui/base/x/x11_util.h" // nogncheck | 53 #include "ui/base/x/x11_util.h" // nogncheck |
| 54 #include "ui/gfx/x/x11_types.h" // nogncheck | 54 #include "ui/gfx/x/x11_types.h" // nogncheck |
| 55 | 55 |
| 56 // Including this at the bottom to avoid other | 56 // Including this at the bottom to avoid other |
| 57 // potential conflict with chrome headers. | 57 // potential conflict with chrome headers. |
| (...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 759 aura::Window* root_window = GetRootWindowForDisplayId(display.id()); | 759 aura::Window* root_window = GetRootWindowForDisplayId(display.id()); |
| 760 ::wm::ConvertPointFromScreen(root_window, &point_in_native); | 760 ::wm::ConvertPointFromScreen(root_window, &point_in_native); |
| 761 root_window->GetHost()->ConvertPointToNativeScreen(&point_in_native); | 761 root_window->GetHost()->ConvertPointToNativeScreen(&point_in_native); |
| 762 cursor_location_in_native_coords_for_restore_ = point_in_native; | 762 cursor_location_in_native_coords_for_restore_ = point_in_native; |
| 763 } | 763 } |
| 764 | 764 |
| 765 void WindowTreeHostManager::PostDisplayConfigurationChange() { | 765 void WindowTreeHostManager::PostDisplayConfigurationChange() { |
| 766 focus_activation_store_->Restore(); | 766 focus_activation_store_->Restore(); |
| 767 | 767 |
| 768 DisplayManager* display_manager = GetDisplayManager(); | 768 DisplayManager* display_manager = GetDisplayManager(); |
| 769 DisplayLayoutStore* layout_store = display_manager->layout_store(); | 769 display::DisplayLayoutStore* layout_store = display_manager->layout_store(); |
| 770 if (display_manager->num_connected_displays() > 1) { | 770 if (display_manager->num_connected_displays() > 1) { |
| 771 display::DisplayIdList list = display_manager->GetCurrentDisplayIdList(); | 771 display::DisplayIdList list = display_manager->GetCurrentDisplayIdList(); |
| 772 const display::DisplayLayout& layout = | 772 const display::DisplayLayout& layout = |
| 773 layout_store->GetRegisteredDisplayLayout(list); | 773 layout_store->GetRegisteredDisplayLayout(list); |
| 774 layout_store->UpdateMultiDisplayState( | 774 layout_store->UpdateMultiDisplayState( |
| 775 list, display_manager->IsInMirrorMode(), layout.default_unified); | 775 list, display_manager->IsInMirrorMode(), layout.default_unified); |
| 776 if (display::Screen::GetScreen()->GetNumDisplays() > 1) { | 776 if (display::Screen::GetScreen()->GetNumDisplays() > 1) { |
| 777 SetPrimaryDisplayId(layout.primary_id == | 777 SetPrimaryDisplayId(layout.primary_id == |
| 778 display::Display::kInvalidDisplayID | 778 display::Display::kInvalidDisplayID |
| 779 ? list[0] | 779 ? list[0] |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 845 SetDisplayPropertiesOnHost(ash_host, display); | 845 SetDisplayPropertiesOnHost(ash_host, display); |
| 846 | 846 |
| 847 #if defined(OS_CHROMEOS) | 847 #if defined(OS_CHROMEOS) |
| 848 if (switches::ConstrainPointerToRoot()) | 848 if (switches::ConstrainPointerToRoot()) |
| 849 ash_host->ConfineCursorToRootWindow(); | 849 ash_host->ConfineCursorToRootWindow(); |
| 850 #endif | 850 #endif |
| 851 return ash_host; | 851 return ash_host; |
| 852 } | 852 } |
| 853 | 853 |
| 854 } // namespace ash | 854 } // namespace ash |
| OLD | NEW |