| 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/root_window_controller.h" | 5 #include "ash/root_window_controller.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <queue> | 8 #include <queue> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 #include "ash/system/tray/system_tray_delegate.h" | 33 #include "ash/system/tray/system_tray_delegate.h" |
| 34 #include "ash/touch/touch_hud_debug.h" | 34 #include "ash/touch/touch_hud_debug.h" |
| 35 #include "ash/touch/touch_hud_projection.h" | 35 #include "ash/touch/touch_hud_projection.h" |
| 36 #include "ash/touch/touch_observer_hud.h" | 36 #include "ash/touch/touch_observer_hud.h" |
| 37 #include "ash/wallpaper/wallpaper_delegate.h" | 37 #include "ash/wallpaper/wallpaper_delegate.h" |
| 38 #include "ash/wallpaper/wallpaper_widget_controller.h" | 38 #include "ash/wallpaper/wallpaper_widget_controller.h" |
| 39 #include "ash/wm/always_on_top_controller.h" | 39 #include "ash/wm/always_on_top_controller.h" |
| 40 #include "ash/wm/boot_splash_screen_chromeos.h" | 40 #include "ash/wm/boot_splash_screen_chromeos.h" |
| 41 #include "ash/wm/container_finder.h" | 41 #include "ash/wm/container_finder.h" |
| 42 #include "ash/wm/fullscreen_window_finder.h" | 42 #include "ash/wm/fullscreen_window_finder.h" |
| 43 #include "ash/wm/lock_action_handler_layout_manager.h" |
| 43 #include "ash/wm/lock_layout_manager.h" | 44 #include "ash/wm/lock_layout_manager.h" |
| 44 #include "ash/wm/panels/attached_panel_window_targeter.h" | 45 #include "ash/wm/panels/attached_panel_window_targeter.h" |
| 45 #include "ash/wm/panels/panel_layout_manager.h" | 46 #include "ash/wm/panels/panel_layout_manager.h" |
| 46 #include "ash/wm/panels/panel_window_event_handler.h" | 47 #include "ash/wm/panels/panel_window_event_handler.h" |
| 47 #include "ash/wm/root_window_layout_manager.h" | 48 #include "ash/wm/root_window_layout_manager.h" |
| 48 #include "ash/wm/stacking_controller.h" | 49 #include "ash/wm/stacking_controller.h" |
| 49 #include "ash/wm/switchable_windows.h" | 50 #include "ash/wm/switchable_windows.h" |
| 50 #include "ash/wm/system_modal_container_layout_manager.h" | 51 #include "ash/wm/system_modal_container_layout_manager.h" |
| 51 #include "ash/wm/system_wallpaper_controller.h" | 52 #include "ash/wm/system_wallpaper_controller.h" |
| 52 #include "ash/wm/window_properties.h" | 53 #include "ash/wm/window_properties.h" |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 void ReparentAllWindows(aura::Window* src, aura::Window* dst) { | 202 void ReparentAllWindows(aura::Window* src, aura::Window* dst) { |
| 202 // Set of windows to move. | 203 // Set of windows to move. |
| 203 const int kContainerIdsToMove[] = { | 204 const int kContainerIdsToMove[] = { |
| 204 kShellWindowId_DefaultContainer, | 205 kShellWindowId_DefaultContainer, |
| 205 kShellWindowId_PanelContainer, | 206 kShellWindowId_PanelContainer, |
| 206 kShellWindowId_AlwaysOnTopContainer, | 207 kShellWindowId_AlwaysOnTopContainer, |
| 207 kShellWindowId_SystemModalContainer, | 208 kShellWindowId_SystemModalContainer, |
| 208 kShellWindowId_LockSystemModalContainer, | 209 kShellWindowId_LockSystemModalContainer, |
| 209 kShellWindowId_UnparentedControlContainer, | 210 kShellWindowId_UnparentedControlContainer, |
| 210 kShellWindowId_OverlayContainer, | 211 kShellWindowId_OverlayContainer, |
| 212 kShellWindowId_LockActionHandlerContainer, |
| 213 kShellWindowId_LockActionHandlerContainer_Background, |
| 211 }; | 214 }; |
| 212 const int kExtraContainerIdsToMoveInUnifiedMode[] = { | 215 const int kExtraContainerIdsToMoveInUnifiedMode[] = { |
| 213 kShellWindowId_LockScreenContainer, | 216 kShellWindowId_LockScreenContainer, |
| 214 kShellWindowId_LockScreenWallpaperContainer, | 217 kShellWindowId_LockScreenWallpaperContainer, |
| 215 }; | 218 }; |
| 216 std::vector<int> container_ids( | 219 std::vector<int> container_ids( |
| 217 kContainerIdsToMove, | 220 kContainerIdsToMove, |
| 218 kContainerIdsToMove + arraysize(kContainerIdsToMove)); | 221 kContainerIdsToMove + arraysize(kContainerIdsToMove)); |
| 219 // Check the display mode as this is also necessary when trasitioning between | 222 // Check the display mode as this is also necessary when trasitioning between |
| 220 // mirror and unified mode. | 223 // mirror and unified mode. |
| (...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 802 GetContainer(kShellWindowId_SystemModalContainer); | 805 GetContainer(kShellWindowId_SystemModalContainer); |
| 803 modal_container->SetLayoutManager( | 806 modal_container->SetLayoutManager( |
| 804 new SystemModalContainerLayoutManager(modal_container)); | 807 new SystemModalContainerLayoutManager(modal_container)); |
| 805 | 808 |
| 806 aura::Window* lock_modal_container = | 809 aura::Window* lock_modal_container = |
| 807 GetContainer(kShellWindowId_LockSystemModalContainer); | 810 GetContainer(kShellWindowId_LockSystemModalContainer); |
| 808 DCHECK(lock_modal_container); | 811 DCHECK(lock_modal_container); |
| 809 lock_modal_container->SetLayoutManager( | 812 lock_modal_container->SetLayoutManager( |
| 810 new SystemModalContainerLayoutManager(lock_modal_container)); | 813 new SystemModalContainerLayoutManager(lock_modal_container)); |
| 811 | 814 |
| 815 aura::Window* lock_action_handler_container = |
| 816 GetContainer(kShellWindowId_LockActionHandlerContainer); |
| 817 DCHECK(lock_action_handler_container); |
| 818 lock_action_handler_container->SetLayoutManager( |
| 819 new LockActionHandlerLayoutManager(lock_action_handler_container, |
| 820 wm_shelf_.get())); |
| 821 |
| 822 aura::Window* lock_action_handler_container_background = |
| 823 GetContainer(kShellWindowId_LockActionHandlerContainer_Background); |
| 824 DCHECK(lock_action_handler_container_background); |
| 825 lock_action_handler_container_background->SetLayoutManager( |
| 826 new LockActionHandlerLayoutManager( |
| 827 lock_action_handler_container_background, wm_shelf_.get())); |
| 828 |
| 812 aura::Window* lock_container = | 829 aura::Window* lock_container = |
| 813 GetContainer(kShellWindowId_LockScreenContainer); | 830 GetContainer(kShellWindowId_LockScreenContainer); |
| 814 DCHECK(lock_container); | 831 DCHECK(lock_container); |
| 815 lock_container->SetLayoutManager(new LockLayoutManager(lock_container)); | 832 lock_container->SetLayoutManager(new LockLayoutManager(lock_container)); |
| 816 | 833 |
| 817 WmWindow* always_on_top_container = | 834 WmWindow* always_on_top_container = |
| 818 GetWmContainer(kShellWindowId_AlwaysOnTopContainer); | 835 GetWmContainer(kShellWindowId_AlwaysOnTopContainer); |
| 819 DCHECK(always_on_top_container); | 836 DCHECK(always_on_top_container); |
| 820 always_on_top_controller_ = | 837 always_on_top_controller_ = |
| 821 base::MakeUnique<AlwaysOnTopController>(always_on_top_container); | 838 base::MakeUnique<AlwaysOnTopController>(always_on_top_container); |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 950 | 967 |
| 951 WmWindow* modal_container = | 968 WmWindow* modal_container = |
| 952 CreateContainer(kShellWindowId_SystemModalContainer, | 969 CreateContainer(kShellWindowId_SystemModalContainer, |
| 953 "SystemModalContainer", non_lock_screen_containers); | 970 "SystemModalContainer", non_lock_screen_containers); |
| 954 modal_container->SetSnapsChildrenToPhysicalPixelBoundary(); | 971 modal_container->SetSnapsChildrenToPhysicalPixelBoundary(); |
| 955 modal_container->SetChildWindowVisibilityChangesAnimated(); | 972 modal_container->SetChildWindowVisibilityChangesAnimated(); |
| 956 modal_container->SetBoundsInScreenBehaviorForChildren( | 973 modal_container->SetBoundsInScreenBehaviorForChildren( |
| 957 WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES); | 974 WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES); |
| 958 modal_container->SetChildrenUseExtendedHitRegion(); | 975 modal_container->SetChildrenUseExtendedHitRegion(); |
| 959 | 976 |
| 977 WmWindow* lock_action_handler_container_background = CreateContainer( |
| 978 kShellWindowId_LockActionHandlerContainer_Background, |
| 979 "LockActionHandlerContainer_Background", lock_screen_containers); |
| 980 lock_action_handler_container_background |
| 981 ->SetSnapsChildrenToPhysicalPixelBoundary(); |
| 982 lock_action_handler_container_background |
| 983 ->SetChildWindowVisibilityChangesAnimated(); |
| 984 lock_action_handler_container_background |
| 985 ->SetBoundsInScreenBehaviorForChildren( |
| 986 WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES); |
| 987 |
| 960 // TODO(beng): Figure out if we can make this use | 988 // TODO(beng): Figure out if we can make this use |
| 961 // SystemModalContainerEventFilter instead of stops_event_propagation. | 989 // SystemModalContainerEventFilter instead of stops_event_propagation. |
| 962 WmWindow* lock_container = | 990 WmWindow* lock_container = |
| 963 CreateContainer(kShellWindowId_LockScreenContainer, "LockScreenContainer", | 991 CreateContainer(kShellWindowId_LockScreenContainer, "LockScreenContainer", |
| 964 lock_screen_containers); | 992 lock_screen_containers); |
| 965 lock_container->SetSnapsChildrenToPhysicalPixelBoundary(); | 993 lock_container->SetSnapsChildrenToPhysicalPixelBoundary(); |
| 966 lock_container->SetBoundsInScreenBehaviorForChildren( | 994 lock_container->SetBoundsInScreenBehaviorForChildren( |
| 967 WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES); | 995 WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES); |
| 968 // TODO(beng): stopsevents | 996 // TODO(beng): stopsevents |
| 969 | 997 |
| 998 WmWindow* lock_action_handler_container = |
| 999 CreateContainer(kShellWindowId_LockActionHandlerContainer, |
| 1000 "LockActionHandlerContainer", lock_screen_containers); |
| 1001 lock_action_handler_container->SetSnapsChildrenToPhysicalPixelBoundary(); |
| 1002 lock_action_handler_container->SetChildWindowVisibilityChangesAnimated(); |
| 1003 lock_action_handler_container->SetBoundsInScreenBehaviorForChildren( |
| 1004 WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES); |
| 1005 |
| 970 WmWindow* lock_modal_container = | 1006 WmWindow* lock_modal_container = |
| 971 CreateContainer(kShellWindowId_LockSystemModalContainer, | 1007 CreateContainer(kShellWindowId_LockSystemModalContainer, |
| 972 "LockSystemModalContainer", lock_screen_containers); | 1008 "LockSystemModalContainer", lock_screen_containers); |
| 973 lock_modal_container->SetSnapsChildrenToPhysicalPixelBoundary(); | 1009 lock_modal_container->SetSnapsChildrenToPhysicalPixelBoundary(); |
| 974 lock_modal_container->SetChildWindowVisibilityChangesAnimated(); | 1010 lock_modal_container->SetChildWindowVisibilityChangesAnimated(); |
| 975 lock_modal_container->SetBoundsInScreenBehaviorForChildren( | 1011 lock_modal_container->SetBoundsInScreenBehaviorForChildren( |
| 976 WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES); | 1012 WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES); |
| 977 lock_modal_container->SetChildrenUseExtendedHitRegion(); | 1013 lock_modal_container->SetChildrenUseExtendedHitRegion(); |
| 978 | 1014 |
| 979 WmWindow* status_container = | 1015 WmWindow* status_container = |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1097 EnableTouchHudProjection(); | 1133 EnableTouchHudProjection(); |
| 1098 else | 1134 else |
| 1099 DisableTouchHudProjection(); | 1135 DisableTouchHudProjection(); |
| 1100 } | 1136 } |
| 1101 | 1137 |
| 1102 RootWindowController* GetRootWindowController(const aura::Window* root_window) { | 1138 RootWindowController* GetRootWindowController(const aura::Window* root_window) { |
| 1103 return root_window ? GetRootWindowSettings(root_window)->controller : nullptr; | 1139 return root_window ? GetRootWindowSettings(root_window)->controller : nullptr; |
| 1104 } | 1140 } |
| 1105 | 1141 |
| 1106 } // namespace ash | 1142 } // namespace ash |
| OLD | NEW |