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 850 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
861 gfx::Insets touch_extend = | 861 gfx::Insets touch_extend = |
862 mouse_extend.Scale(kResizeOutsideBoundsScaleForTouch); | 862 mouse_extend.Scale(kResizeOutsideBoundsScaleForTouch); |
863 aura::Window* panel_container = GetContainer(kShellWindowId_PanelContainer); | 863 aura::Window* panel_container = GetContainer(kShellWindowId_PanelContainer); |
864 panel_container->SetEventTargeter(std::unique_ptr<ui::EventTargeter>( | 864 panel_container->SetEventTargeter(std::unique_ptr<ui::EventTargeter>( |
865 new AttachedPanelWindowTargeter(panel_container, mouse_extend, | 865 new AttachedPanelWindowTargeter(panel_container, mouse_extend, |
866 touch_extend, panel_layout_manager()))); | 866 touch_extend, panel_layout_manager()))); |
867 } | 867 } |
868 | 868 |
869 void RootWindowController::CreateContainers() { | 869 void RootWindowController::CreateContainers() { |
870 WmWindow* root = GetWindow(); | 870 WmWindow* root = GetWindow(); |
871 // For screen rotation animation: add a NOT_DRAWN layer in between the | |
872 // root_window's layer and its current children so that we only need to | |
873 // initiate two LayerAnimationSequences. One for the new layers and one for | |
874 // the old layers. | |
875 WmWindow* delegate_root = CreateContainer( | |
876 kShellWindowId_DelegateRootContainer, "DelegateRootContainer", root); | |
oshima
2017/04/05 20:26:51
"delegate" is overused. maybe surrogate root?
+j
James Cook
2017/04/05 20:54:41
Why not just ScreenRotationContainer, since that's
wutao
2017/04/05 23:37:34
Done.
| |
877 delegate_root->SetChildWindowVisibilityChangesAnimated(); | |
878 delegate_root->GetLayer()->set_name("DelegateRootLayer"); | |
879 | |
871 // These containers are just used by PowerButtonController to animate groups | 880 // These containers are just used by PowerButtonController to animate groups |
872 // of containers simultaneously without messing up the current transformations | 881 // of containers simultaneously without messing up the current transformations |
873 // on those containers. These are direct children of the root window; all of | 882 // on those containers. These are direct children of the delegate_root window; |
874 // the other containers are their children. | 883 // all of the other containers are their children. |
875 | 884 |
876 // The wallpaper container is not part of the lock animation, so it is not | 885 // The wallpaper container is not part of the lock animation, so it is not |
877 // included in those animate groups. When the screen is locked, the wallpaper | 886 // included in those animate groups. When the screen is locked, the wallpaper |
878 // is moved to the lock screen wallpaper container (and moved back on unlock). | 887 // is moved to the lock screen wallpaper container (and moved back on unlock). |
879 // Ensure that there's an opaque layer occluding the non-lock-screen layers. | 888 // Ensure that there's an opaque layer occluding the non-lock-screen layers. |
880 WmWindow* wallpaper_container = CreateContainer( | 889 WmWindow* wallpaper_container = CreateContainer( |
881 kShellWindowId_WallpaperContainer, "WallpaperContainer", root); | 890 kShellWindowId_WallpaperContainer, "WallpaperContainer", delegate_root); |
882 wallpaper_container->SetChildWindowVisibilityChangesAnimated(); | 891 wallpaper_container->SetChildWindowVisibilityChangesAnimated(); |
883 | 892 |
884 WmWindow* non_lock_screen_containers = | 893 WmWindow* non_lock_screen_containers = |
885 CreateContainer(kShellWindowId_NonLockScreenContainersContainer, | 894 CreateContainer(kShellWindowId_NonLockScreenContainersContainer, |
886 "NonLockScreenContainersContainer", root); | 895 "NonLockScreenContainersContainer", delegate_root); |
887 // 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 |
888 // 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. |
889 non_lock_screen_containers->SetMasksToBounds(true); | 898 non_lock_screen_containers->SetMasksToBounds(true); |
890 | 899 |
891 WmWindow* lock_wallpaper_containers = | 900 WmWindow* lock_wallpaper_containers = |
892 CreateContainer(kShellWindowId_LockScreenWallpaperContainer, | 901 CreateContainer(kShellWindowId_LockScreenWallpaperContainer, |
893 "LockScreenWallpaperContainer", root); | 902 "LockScreenWallpaperContainer", delegate_root); |
894 lock_wallpaper_containers->SetChildWindowVisibilityChangesAnimated(); | 903 lock_wallpaper_containers->SetChildWindowVisibilityChangesAnimated(); |
895 | 904 |
896 WmWindow* lock_screen_containers = | 905 WmWindow* lock_screen_containers = |
897 CreateContainer(kShellWindowId_LockScreenContainersContainer, | 906 CreateContainer(kShellWindowId_LockScreenContainersContainer, |
898 "LockScreenContainersContainer", root); | 907 "LockScreenContainersContainer", delegate_root); |
899 WmWindow* lock_screen_related_containers = | 908 WmWindow* lock_screen_related_containers = |
900 CreateContainer(kShellWindowId_LockScreenRelatedContainersContainer, | 909 CreateContainer(kShellWindowId_LockScreenRelatedContainersContainer, |
901 "LockScreenRelatedContainersContainer", root); | 910 "LockScreenRelatedContainersContainer", delegate_root); |
902 | 911 |
903 CreateContainer(kShellWindowId_UnparentedControlContainer, | 912 CreateContainer(kShellWindowId_UnparentedControlContainer, |
904 "UnparentedControlContainer", non_lock_screen_containers); | 913 "UnparentedControlContainer", non_lock_screen_containers); |
905 | 914 |
906 WmWindow* default_container = | 915 WmWindow* default_container = |
907 CreateContainer(kShellWindowId_DefaultContainer, "DefaultContainer", | 916 CreateContainer(kShellWindowId_DefaultContainer, "DefaultContainer", |
908 non_lock_screen_containers); | 917 non_lock_screen_containers); |
909 default_container->SetChildWindowVisibilityChangesAnimated(); | 918 default_container->SetChildWindowVisibilityChangesAnimated(); |
910 default_container->SetSnapsChildrenToPhysicalPixelBoundary(); | 919 default_container->SetSnapsChildrenToPhysicalPixelBoundary(); |
911 default_container->SetBoundsInScreenBehaviorForChildren( | 920 default_container->SetBoundsInScreenBehaviorForChildren( |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1018 drag_drop_container->SetBoundsInScreenBehaviorForChildren( | 1027 drag_drop_container->SetBoundsInScreenBehaviorForChildren( |
1019 WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES); | 1028 WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES); |
1020 | 1029 |
1021 WmWindow* overlay_container = | 1030 WmWindow* overlay_container = |
1022 CreateContainer(kShellWindowId_OverlayContainer, "OverlayContainer", | 1031 CreateContainer(kShellWindowId_OverlayContainer, "OverlayContainer", |
1023 lock_screen_related_containers); | 1032 lock_screen_related_containers); |
1024 overlay_container->SetSnapsChildrenToPhysicalPixelBoundary(); | 1033 overlay_container->SetSnapsChildrenToPhysicalPixelBoundary(); |
1025 overlay_container->SetBoundsInScreenBehaviorForChildren( | 1034 overlay_container->SetBoundsInScreenBehaviorForChildren( |
1026 WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES); | 1035 WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES); |
1027 | 1036 |
1028 WmWindow* mouse_cursor_container = CreateContainer( | 1037 WmWindow* mouse_cursor_container = |
1029 kShellWindowId_MouseCursorContainer, "MouseCursorContainer", root); | 1038 CreateContainer(kShellWindowId_MouseCursorContainer, |
1039 "MouseCursorContainer", delegate_root); | |
1030 mouse_cursor_container->SetBoundsInScreenBehaviorForChildren( | 1040 mouse_cursor_container->SetBoundsInScreenBehaviorForChildren( |
1031 WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES); | 1041 WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES); |
1032 | 1042 |
1033 CreateContainer(kShellWindowId_PowerButtonAnimationContainer, | 1043 CreateContainer(kShellWindowId_PowerButtonAnimationContainer, |
1034 "PowerButtonAnimationContainer", root); | 1044 "PowerButtonAnimationContainer", delegate_root); |
1035 } | 1045 } |
1036 | 1046 |
1037 void RootWindowController::CreateSystemWallpaper( | 1047 void RootWindowController::CreateSystemWallpaper( |
1038 RootWindowType root_window_type) { | 1048 RootWindowType root_window_type) { |
1039 SkColor color = SK_ColorBLACK; | 1049 SkColor color = SK_ColorBLACK; |
1040 // 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 |
1041 // 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 |
1042 // 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. |
1043 const bool is_boot_splash_screen = | 1053 const bool is_boot_splash_screen = |
1044 root_window_type == RootWindowType::PRIMARY && | 1054 root_window_type == RootWindowType::PRIMARY && |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1102 EnableTouchHudProjection(); | 1112 EnableTouchHudProjection(); |
1103 else | 1113 else |
1104 DisableTouchHudProjection(); | 1114 DisableTouchHudProjection(); |
1105 } | 1115 } |
1106 | 1116 |
1107 RootWindowController* GetRootWindowController(const aura::Window* root_window) { | 1117 RootWindowController* GetRootWindowController(const aura::Window* root_window) { |
1108 return root_window ? GetRootWindowSettings(root_window)->controller : nullptr; | 1118 return root_window ? GetRootWindowSettings(root_window)->controller : nullptr; |
1109 } | 1119 } |
1110 | 1120 |
1111 } // namespace ash | 1121 } // namespace ash |
OLD | NEW |