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 849 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
860 gfx::Insets touch_extend = | 860 gfx::Insets touch_extend = |
861 mouse_extend.Scale(kResizeOutsideBoundsScaleForTouch); | 861 mouse_extend.Scale(kResizeOutsideBoundsScaleForTouch); |
862 aura::Window* panel_container = GetContainer(kShellWindowId_PanelContainer); | 862 aura::Window* panel_container = GetContainer(kShellWindowId_PanelContainer); |
863 panel_container->SetEventTargeter(std::unique_ptr<ui::EventTargeter>( | 863 panel_container->SetEventTargeter(std::unique_ptr<ui::EventTargeter>( |
864 new AttachedPanelWindowTargeter(panel_container, mouse_extend, | 864 new AttachedPanelWindowTargeter(panel_container, mouse_extend, |
865 touch_extend, panel_layout_manager()))); | 865 touch_extend, panel_layout_manager()))); |
866 } | 866 } |
867 | 867 |
868 void RootWindowController::CreateContainers() { | 868 void RootWindowController::CreateContainers() { |
869 WmWindow* root = GetWindow(); | 869 WmWindow* root = GetWindow(); |
| 870 // For screen rotation animation: add a NOT_DRAWN layer in between the |
| 871 // root_window's layer and its current children so that we only need to |
| 872 // initiate two LayerAnimationSequences. One for the new layers and one for |
| 873 // the old layers. |
| 874 WmWindow* screen_rotation_container = CreateContainer( |
| 875 kShellWindowId_ScreenRotationContainer, "ScreenRotationContainer", root); |
| 876 screen_rotation_container->SetChildWindowVisibilityChangesAnimated(); |
| 877 |
870 // These containers are just used by PowerButtonController to animate groups | 878 // These containers are just used by PowerButtonController to animate groups |
871 // of containers simultaneously without messing up the current transformations | 879 // of containers simultaneously without messing up the current transformations |
872 // on those containers. These are direct children of the root window; all of | 880 // on those containers. These are direct children of the |
873 // the other containers are their children. | 881 // screen_rotation_container window; all of the other containers are their |
| 882 // children. |
874 | 883 |
875 // The wallpaper container is not part of the lock animation, so it is not | 884 // The wallpaper container is not part of the lock animation, so it is not |
876 // included in those animate groups. When the screen is locked, the wallpaper | 885 // included in those animate groups. When the screen is locked, the wallpaper |
877 // is moved to the lock screen wallpaper container (and moved back on unlock). | 886 // is moved to the lock screen wallpaper container (and moved back on unlock). |
878 // Ensure that there's an opaque layer occluding the non-lock-screen layers. | 887 // Ensure that there's an opaque layer occluding the non-lock-screen layers. |
879 WmWindow* wallpaper_container = CreateContainer( | 888 WmWindow* wallpaper_container = |
880 kShellWindowId_WallpaperContainer, "WallpaperContainer", root); | 889 CreateContainer(kShellWindowId_WallpaperContainer, "WallpaperContainer", |
| 890 screen_rotation_container); |
881 wallpaper_container->SetChildWindowVisibilityChangesAnimated(); | 891 wallpaper_container->SetChildWindowVisibilityChangesAnimated(); |
882 | 892 |
883 WmWindow* non_lock_screen_containers = | 893 WmWindow* non_lock_screen_containers = CreateContainer( |
884 CreateContainer(kShellWindowId_NonLockScreenContainersContainer, | 894 kShellWindowId_NonLockScreenContainersContainer, |
885 "NonLockScreenContainersContainer", root); | 895 "NonLockScreenContainersContainer", screen_rotation_container); |
886 // Clip all windows inside this container, as half pixel of the window's | 896 // Clip all windows inside this container, as half pixel of the window's |
887 // texture may become visible when the screen is scaled. crbug.com/368591. | 897 // texture may become visible when the screen is scaled. crbug.com/368591. |
888 non_lock_screen_containers->SetMasksToBounds(true); | 898 non_lock_screen_containers->SetMasksToBounds(true); |
889 | 899 |
890 WmWindow* lock_wallpaper_containers = | 900 WmWindow* lock_wallpaper_containers = CreateContainer( |
891 CreateContainer(kShellWindowId_LockScreenWallpaperContainer, | 901 kShellWindowId_LockScreenWallpaperContainer, |
892 "LockScreenWallpaperContainer", root); | 902 "LockScreenWallpaperContainer", screen_rotation_container); |
893 lock_wallpaper_containers->SetChildWindowVisibilityChangesAnimated(); | 903 lock_wallpaper_containers->SetChildWindowVisibilityChangesAnimated(); |
894 | 904 |
895 WmWindow* lock_screen_containers = | 905 WmWindow* lock_screen_containers = CreateContainer( |
896 CreateContainer(kShellWindowId_LockScreenContainersContainer, | 906 kShellWindowId_LockScreenContainersContainer, |
897 "LockScreenContainersContainer", root); | 907 "LockScreenContainersContainer", screen_rotation_container); |
898 WmWindow* lock_screen_related_containers = | 908 WmWindow* lock_screen_related_containers = CreateContainer( |
899 CreateContainer(kShellWindowId_LockScreenRelatedContainersContainer, | 909 kShellWindowId_LockScreenRelatedContainersContainer, |
900 "LockScreenRelatedContainersContainer", root); | 910 "LockScreenRelatedContainersContainer", screen_rotation_container); |
901 | 911 |
902 CreateContainer(kShellWindowId_UnparentedControlContainer, | 912 CreateContainer(kShellWindowId_UnparentedControlContainer, |
903 "UnparentedControlContainer", non_lock_screen_containers); | 913 "UnparentedControlContainer", non_lock_screen_containers); |
904 | 914 |
905 WmWindow* default_container = | 915 WmWindow* default_container = |
906 CreateContainer(kShellWindowId_DefaultContainer, "DefaultContainer", | 916 CreateContainer(kShellWindowId_DefaultContainer, "DefaultContainer", |
907 non_lock_screen_containers); | 917 non_lock_screen_containers); |
908 default_container->SetChildWindowVisibilityChangesAnimated(); | 918 default_container->SetChildWindowVisibilityChangesAnimated(); |
909 default_container->SetSnapsChildrenToPhysicalPixelBoundary(); | 919 default_container->SetSnapsChildrenToPhysicalPixelBoundary(); |
910 default_container->SetBoundsInScreenBehaviorForChildren( | 920 default_container->SetBoundsInScreenBehaviorForChildren( |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1017 drag_drop_container->SetBoundsInScreenBehaviorForChildren( | 1027 drag_drop_container->SetBoundsInScreenBehaviorForChildren( |
1018 WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES); | 1028 WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES); |
1019 | 1029 |
1020 WmWindow* overlay_container = | 1030 WmWindow* overlay_container = |
1021 CreateContainer(kShellWindowId_OverlayContainer, "OverlayContainer", | 1031 CreateContainer(kShellWindowId_OverlayContainer, "OverlayContainer", |
1022 lock_screen_related_containers); | 1032 lock_screen_related_containers); |
1023 overlay_container->SetSnapsChildrenToPhysicalPixelBoundary(); | 1033 overlay_container->SetSnapsChildrenToPhysicalPixelBoundary(); |
1024 overlay_container->SetBoundsInScreenBehaviorForChildren( | 1034 overlay_container->SetBoundsInScreenBehaviorForChildren( |
1025 WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES); | 1035 WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES); |
1026 | 1036 |
1027 WmWindow* mouse_cursor_container = CreateContainer( | 1037 WmWindow* mouse_cursor_container = |
1028 kShellWindowId_MouseCursorContainer, "MouseCursorContainer", root); | 1038 CreateContainer(kShellWindowId_MouseCursorContainer, |
| 1039 "MouseCursorContainer", screen_rotation_container); |
1029 mouse_cursor_container->SetBoundsInScreenBehaviorForChildren( | 1040 mouse_cursor_container->SetBoundsInScreenBehaviorForChildren( |
1030 WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES); | 1041 WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES); |
1031 | 1042 |
1032 CreateContainer(kShellWindowId_PowerButtonAnimationContainer, | 1043 CreateContainer(kShellWindowId_PowerButtonAnimationContainer, |
1033 "PowerButtonAnimationContainer", root); | 1044 "PowerButtonAnimationContainer", screen_rotation_container); |
1034 } | 1045 } |
1035 | 1046 |
1036 void RootWindowController::CreateSystemWallpaper( | 1047 void RootWindowController::CreateSystemWallpaper( |
1037 RootWindowType root_window_type) { | 1048 RootWindowType root_window_type) { |
1038 SkColor color = SK_ColorBLACK; | 1049 SkColor color = SK_ColorBLACK; |
1039 // The splash screen appears on the primary display at boot. If this is a | 1050 // The splash screen appears on the primary display at boot. If this is a |
1040 // secondary monitor (either connected at boot or connected later) or if the | 1051 // secondary monitor (either connected at boot or connected later) or if the |
1041 // browser restarted for a second login then don't use the boot color. | 1052 // browser restarted for a second login then don't use the boot color. |
1042 const bool is_boot_splash_screen = | 1053 const bool is_boot_splash_screen = |
1043 root_window_type == RootWindowType::PRIMARY && | 1054 root_window_type == RootWindowType::PRIMARY && |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1101 EnableTouchHudProjection(); | 1112 EnableTouchHudProjection(); |
1102 else | 1113 else |
1103 DisableTouchHudProjection(); | 1114 DisableTouchHudProjection(); |
1104 } | 1115 } |
1105 | 1116 |
1106 RootWindowController* GetRootWindowController(const aura::Window* root_window) { | 1117 RootWindowController* GetRootWindowController(const aura::Window* root_window) { |
1107 return root_window ? GetRootWindowSettings(root_window)->controller : nullptr; | 1118 return root_window ? GetRootWindowSettings(root_window)->controller : nullptr; |
1108 } | 1119 } |
1109 | 1120 |
1110 } // namespace ash | 1121 } // namespace ash |
OLD | NEW |