Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(509)

Side by Side Diff: ash/root_window_controller.cc

Issue 2786563003: Add a NOT_DRAWN window in between the root_window and its children. (Closed)
Patch Set: Rebased to origin/master. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ash/public/cpp/shell_window_ids.h ('k') | ash/rotator/screen_rotation_animator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
870 // These containers are just used by PowerButtonController to animate groups 877 // These containers are just used by PowerButtonController to animate groups
871 // of containers simultaneously without messing up the current transformations 878 // of containers simultaneously without messing up the current transformations
872 // on those containers. These are direct children of the root window; all of 879 // on those containers. These are direct children of the
873 // the other containers are their children. 880 // screen_rotation_container window; all of the other containers are their
881 // children.
874 882
875 // The wallpaper container is not part of the lock animation, so it is not 883 // 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 884 // 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). 885 // 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. 886 // Ensure that there's an opaque layer occluding the non-lock-screen layers.
879 WmWindow* wallpaper_container = CreateContainer( 887 WmWindow* wallpaper_container =
880 kShellWindowId_WallpaperContainer, "WallpaperContainer", root); 888 CreateContainer(kShellWindowId_WallpaperContainer, "WallpaperContainer",
889 screen_rotation_container);
881 wallpaper_container->SetChildWindowVisibilityChangesAnimated(); 890 wallpaper_container->SetChildWindowVisibilityChangesAnimated();
882 891
883 WmWindow* non_lock_screen_containers = 892 WmWindow* non_lock_screen_containers = CreateContainer(
884 CreateContainer(kShellWindowId_NonLockScreenContainersContainer, 893 kShellWindowId_NonLockScreenContainersContainer,
885 "NonLockScreenContainersContainer", root); 894 "NonLockScreenContainersContainer", screen_rotation_container);
886 // Clip all windows inside this container, as half pixel of the window's 895 // 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. 896 // texture may become visible when the screen is scaled. crbug.com/368591.
888 non_lock_screen_containers->SetMasksToBounds(true); 897 non_lock_screen_containers->SetMasksToBounds(true);
889 898
890 WmWindow* lock_wallpaper_containers = 899 WmWindow* lock_wallpaper_containers = CreateContainer(
891 CreateContainer(kShellWindowId_LockScreenWallpaperContainer, 900 kShellWindowId_LockScreenWallpaperContainer,
892 "LockScreenWallpaperContainer", root); 901 "LockScreenWallpaperContainer", screen_rotation_container);
893 lock_wallpaper_containers->SetChildWindowVisibilityChangesAnimated(); 902 lock_wallpaper_containers->SetChildWindowVisibilityChangesAnimated();
894 903
895 WmWindow* lock_screen_containers = 904 WmWindow* lock_screen_containers = CreateContainer(
896 CreateContainer(kShellWindowId_LockScreenContainersContainer, 905 kShellWindowId_LockScreenContainersContainer,
897 "LockScreenContainersContainer", root); 906 "LockScreenContainersContainer", screen_rotation_container);
898 WmWindow* lock_screen_related_containers = 907 WmWindow* lock_screen_related_containers = CreateContainer(
899 CreateContainer(kShellWindowId_LockScreenRelatedContainersContainer, 908 kShellWindowId_LockScreenRelatedContainersContainer,
900 "LockScreenRelatedContainersContainer", root); 909 "LockScreenRelatedContainersContainer", screen_rotation_container);
901 910
902 CreateContainer(kShellWindowId_UnparentedControlContainer, 911 CreateContainer(kShellWindowId_UnparentedControlContainer,
903 "UnparentedControlContainer", non_lock_screen_containers); 912 "UnparentedControlContainer", non_lock_screen_containers);
904 913
905 WmWindow* default_container = 914 WmWindow* default_container =
906 CreateContainer(kShellWindowId_DefaultContainer, "DefaultContainer", 915 CreateContainer(kShellWindowId_DefaultContainer, "DefaultContainer",
907 non_lock_screen_containers); 916 non_lock_screen_containers);
908 default_container->SetChildWindowVisibilityChangesAnimated(); 917 default_container->SetChildWindowVisibilityChangesAnimated();
909 default_container->SetSnapsChildrenToPhysicalPixelBoundary(); 918 default_container->SetSnapsChildrenToPhysicalPixelBoundary();
910 default_container->SetBoundsInScreenBehaviorForChildren( 919 default_container->SetBoundsInScreenBehaviorForChildren(
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
1017 drag_drop_container->SetBoundsInScreenBehaviorForChildren( 1026 drag_drop_container->SetBoundsInScreenBehaviorForChildren(
1018 WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES); 1027 WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES);
1019 1028
1020 WmWindow* overlay_container = 1029 WmWindow* overlay_container =
1021 CreateContainer(kShellWindowId_OverlayContainer, "OverlayContainer", 1030 CreateContainer(kShellWindowId_OverlayContainer, "OverlayContainer",
1022 lock_screen_related_containers); 1031 lock_screen_related_containers);
1023 overlay_container->SetSnapsChildrenToPhysicalPixelBoundary(); 1032 overlay_container->SetSnapsChildrenToPhysicalPixelBoundary();
1024 overlay_container->SetBoundsInScreenBehaviorForChildren( 1033 overlay_container->SetBoundsInScreenBehaviorForChildren(
1025 WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES); 1034 WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES);
1026 1035
1027 WmWindow* mouse_cursor_container = CreateContainer( 1036 WmWindow* mouse_cursor_container =
1028 kShellWindowId_MouseCursorContainer, "MouseCursorContainer", root); 1037 CreateContainer(kShellWindowId_MouseCursorContainer,
1038 "MouseCursorContainer", screen_rotation_container);
1029 mouse_cursor_container->SetBoundsInScreenBehaviorForChildren( 1039 mouse_cursor_container->SetBoundsInScreenBehaviorForChildren(
1030 WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES); 1040 WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES);
1031 1041
1032 CreateContainer(kShellWindowId_PowerButtonAnimationContainer, 1042 CreateContainer(kShellWindowId_PowerButtonAnimationContainer,
1033 "PowerButtonAnimationContainer", root); 1043 "PowerButtonAnimationContainer", screen_rotation_container);
1034 } 1044 }
1035 1045
1036 void RootWindowController::CreateSystemWallpaper( 1046 void RootWindowController::CreateSystemWallpaper(
1037 RootWindowType root_window_type) { 1047 RootWindowType root_window_type) {
1038 SkColor color = SK_ColorBLACK; 1048 SkColor color = SK_ColorBLACK;
1039 // The splash screen appears on the primary display at boot. If this is a 1049 // 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 1050 // 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. 1051 // browser restarted for a second login then don't use the boot color.
1042 const bool is_boot_splash_screen = 1052 const bool is_boot_splash_screen =
1043 root_window_type == RootWindowType::PRIMARY && 1053 root_window_type == RootWindowType::PRIMARY &&
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
1101 EnableTouchHudProjection(); 1111 EnableTouchHudProjection();
1102 else 1112 else
1103 DisableTouchHudProjection(); 1113 DisableTouchHudProjection();
1104 } 1114 }
1105 1115
1106 RootWindowController* GetRootWindowController(const aura::Window* root_window) { 1116 RootWindowController* GetRootWindowController(const aura::Window* root_window) {
1107 return root_window ? GetRootWindowSettings(root_window)->controller : nullptr; 1117 return root_window ? GetRootWindowSettings(root_window)->controller : nullptr;
1108 } 1118 }
1109 1119
1110 } // namespace ash 1120 } // namespace ash
OLDNEW
« no previous file with comments | « ash/public/cpp/shell_window_ids.h ('k') | ash/rotator/screen_rotation_animator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698