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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 #include "ui/aura/client/window_types.h" | 67 #include "ui/aura/client/window_types.h" |
68 #include "ui/aura/mus/window_mus.h" | 68 #include "ui/aura/mus/window_mus.h" |
69 #include "ui/aura/mus/window_port_mus.h" | 69 #include "ui/aura/mus/window_port_mus.h" |
70 #include "ui/aura/mus/window_tree_client.h" | 70 #include "ui/aura/mus/window_tree_client.h" |
71 #include "ui/aura/window.h" | 71 #include "ui/aura/window.h" |
72 #include "ui/aura/window_event_dispatcher.h" | 72 #include "ui/aura/window_event_dispatcher.h" |
73 #include "ui/aura/window_observer.h" | 73 #include "ui/aura/window_observer.h" |
74 #include "ui/aura/window_tracker.h" | 74 #include "ui/aura/window_tracker.h" |
75 #include "ui/base/models/menu_model.h" | 75 #include "ui/base/models/menu_model.h" |
76 #include "ui/chromeos/touch_exploration_controller.h" | 76 #include "ui/chromeos/touch_exploration_controller.h" |
| 77 #include "ui/compositor/layer.h" |
77 #include "ui/display/types/display_constants.h" | 78 #include "ui/display/types/display_constants.h" |
78 #include "ui/events/event_utils.h" | 79 #include "ui/events/event_utils.h" |
79 #include "ui/keyboard/keyboard_controller.h" | 80 #include "ui/keyboard/keyboard_controller.h" |
80 #include "ui/keyboard/keyboard_util.h" | 81 #include "ui/keyboard/keyboard_util.h" |
81 #include "ui/views/controls/menu/menu_model_adapter.h" | 82 #include "ui/views/controls/menu/menu_model_adapter.h" |
82 #include "ui/views/controls/menu/menu_runner.h" | 83 #include "ui/views/controls/menu/menu_runner.h" |
83 #include "ui/views/view_model.h" | 84 #include "ui/views/view_model.h" |
84 #include "ui/views/view_model_utils.h" | 85 #include "ui/views/view_model_utils.h" |
85 #include "ui/wm/core/capture_controller.h" | 86 #include "ui/wm/core/capture_controller.h" |
86 #include "ui/wm/core/coordinate_conversion.h" | 87 #include "ui/wm/core/coordinate_conversion.h" |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 } | 240 } |
240 // If the entire window list is modal background windows then stop. | 241 // If the entire window list is modal background windows then stop. |
241 if (iter == src_container_children.end()) | 242 if (iter == src_container_children.end()) |
242 break; | 243 break; |
243 ReparentWindow(*iter, dst_container); | 244 ReparentWindow(*iter, dst_container); |
244 } | 245 } |
245 } | 246 } |
246 } | 247 } |
247 | 248 |
248 // Creates a new window for use as a container. | 249 // Creates a new window for use as a container. |
249 // TODO(sky): This should create an aura::Window. http://crbug.com/671246. | 250 aura::Window* CreateContainer(int window_id, |
250 WmWindow* CreateContainer(int window_id, const char* name, WmWindow* parent) { | 251 const char* name, |
| 252 aura::Window* parent) { |
251 aura::Window* window = | 253 aura::Window* window = |
252 new aura::Window(nullptr, aura::client::WINDOW_TYPE_UNKNOWN); | 254 new aura::Window(nullptr, aura::client::WINDOW_TYPE_UNKNOWN); |
253 window->Init(ui::LAYER_NOT_DRAWN); | 255 window->Init(ui::LAYER_NOT_DRAWN); |
254 if (Shell::GetAshConfig() != Config::CLASSIC) { | 256 if (Shell::GetAshConfig() != Config::CLASSIC) { |
255 aura::WindowPortMus::Get(window)->SetEventTargetingPolicy( | 257 aura::WindowPortMus::Get(window)->SetEventTargetingPolicy( |
256 ui::mojom::EventTargetingPolicy::DESCENDANTS_ONLY); | 258 ui::mojom::EventTargetingPolicy::DESCENDANTS_ONLY); |
257 } | 259 } |
258 window->set_id(window_id); | 260 window->set_id(window_id); |
259 window->SetName(name); | 261 window->SetName(name); |
260 parent->aura_window()->AddChild(window); | 262 parent->AddChild(window); |
261 if (window_id != kShellWindowId_UnparentedControlContainer) | 263 if (window_id != kShellWindowId_UnparentedControlContainer) |
262 window->Show(); | 264 window->Show(); |
263 return WmWindow::Get(window); | 265 return window; |
264 } | 266 } |
265 | 267 |
266 // TODO(sky): This should take an aura::Window. http://crbug.com/671246. | 268 bool ShouldDestroyWindowInCloseChildWindows(aura::Window* window) { |
267 bool ShouldDestroyWindowInCloseChildWindows(WmWindow* window) { | 269 if (!window->owned_by_parent()) |
268 if (!WmWindow::GetAuraWindow(window)->owned_by_parent()) | |
269 return false; | 270 return false; |
270 | 271 |
271 if (Shell::GetAshConfig() != Config::MASH) | 272 if (Shell::GetAshConfig() != Config::MASH) |
272 return true; | 273 return true; |
273 | 274 |
274 aura::WindowMus* window_mus = | 275 aura::WindowMus* window_mus = aura::WindowMus::Get(window); |
275 aura::WindowMus::Get(WmWindow::GetAuraWindow(window)); | |
276 return Shell::window_tree_client()->WasCreatedByThisClient(window_mus) || | 276 return Shell::window_tree_client()->WasCreatedByThisClient(window_mus) || |
277 Shell::window_tree_client()->IsRoot(window_mus); | 277 Shell::window_tree_client()->IsRoot(window_mus); |
278 } | 278 } |
279 | 279 |
280 } // namespace | 280 } // namespace |
281 | 281 |
282 // static | 282 // static |
283 std::vector<RootWindowController*>* | 283 std::vector<RootWindowController*>* |
284 RootWindowController::root_window_controllers_ = nullptr; | 284 RootWindowController::root_window_controllers_ = nullptr; |
285 | 285 |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
561 } | 561 } |
562 | 562 |
563 Shelf* shelf = GetShelf(); | 563 Shelf* shelf = GetShelf(); |
564 shelf->ShutdownShelfWidget(); | 564 shelf->ShutdownShelfWidget(); |
565 | 565 |
566 workspace_controller_.reset(); | 566 workspace_controller_.reset(); |
567 | 567 |
568 // Explicitly destroy top level windows. We do this because such windows may | 568 // Explicitly destroy top level windows. We do this because such windows may |
569 // query the RootWindow for state. | 569 // query the RootWindow for state. |
570 aura::WindowTracker non_toplevel_windows; | 570 aura::WindowTracker non_toplevel_windows; |
571 WmWindow* root = GetWindow(); | 571 aura::Window* root = GetRootWindow(); |
572 non_toplevel_windows.Add(root->aura_window()); | 572 non_toplevel_windows.Add(root); |
573 while (!non_toplevel_windows.windows().empty()) { | 573 while (!non_toplevel_windows.windows().empty()) { |
574 aura::Window* non_toplevel_window = non_toplevel_windows.Pop(); | 574 aura::Window* non_toplevel_window = non_toplevel_windows.Pop(); |
575 aura::WindowTracker toplevel_windows; | 575 aura::WindowTracker toplevel_windows; |
576 for (aura::Window* child : non_toplevel_window->children()) { | 576 for (aura::Window* child : non_toplevel_window->children()) { |
577 if (!ShouldDestroyWindowInCloseChildWindows(WmWindow::Get(child))) | 577 if (!ShouldDestroyWindowInCloseChildWindows(child)) |
578 continue; | 578 continue; |
579 if (child->delegate()) | 579 if (child->delegate()) |
580 toplevel_windows.Add(child); | 580 toplevel_windows.Add(child); |
581 else | 581 else |
582 non_toplevel_windows.Add(child); | 582 non_toplevel_windows.Add(child); |
583 } | 583 } |
584 while (!toplevel_windows.windows().empty()) | 584 while (!toplevel_windows.windows().empty()) |
585 delete toplevel_windows.Pop(); | 585 delete toplevel_windows.Pop(); |
586 } | 586 } |
587 // And then remove the containers. | 587 // And then remove the containers. |
588 while (!root->GetChildren().empty()) { | 588 while (!root->children().empty()) { |
589 WmWindow* child = root->GetChildren()[0]; | 589 aura::Window* child = root->children()[0]; |
590 if (ShouldDestroyWindowInCloseChildWindows(child)) | 590 if (ShouldDestroyWindowInCloseChildWindows(child)) |
591 child->Destroy(); | 591 delete child; |
592 else | 592 else |
593 root->RemoveChild(child); | 593 root->RemoveChild(child); |
594 } | 594 } |
595 | 595 |
596 shelf->DestroyShelfWidget(); | 596 shelf->DestroyShelfWidget(); |
597 | 597 |
598 aura::client::SetDragDropClient(GetRootWindow(), nullptr); | 598 aura::client::SetDragDropClient(GetRootWindow(), nullptr); |
599 aura::client::SetTooltipClient(GetRootWindow(), nullptr); | 599 aura::client::SetTooltipClient(GetRootWindow(), nullptr); |
600 } | 600 } |
601 | 601 |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
818 // Create Panel layout manager | 818 // Create Panel layout manager |
819 aura::Window* panel_container = GetContainer(kShellWindowId_PanelContainer); | 819 aura::Window* panel_container = GetContainer(kShellWindowId_PanelContainer); |
820 panel_layout_manager_ = new PanelLayoutManager(panel_container); | 820 panel_layout_manager_ = new PanelLayoutManager(panel_container); |
821 panel_container->SetLayoutManager(panel_layout_manager_); | 821 panel_container->SetLayoutManager(panel_layout_manager_); |
822 | 822 |
823 wm::WmSnapToPixelLayoutManager::InstallOnContainers(root); | 823 wm::WmSnapToPixelLayoutManager::InstallOnContainers(root); |
824 | 824 |
825 // Make it easier to resize windows that partially overlap the shelf. Must | 825 // Make it easier to resize windows that partially overlap the shelf. Must |
826 // occur after the ShelfLayoutManager is constructed by ShelfWidget. | 826 // occur after the ShelfLayoutManager is constructed by ShelfWidget. |
827 aura::Window* shelf_container = GetContainer(kShellWindowId_ShelfContainer); | 827 aura::Window* shelf_container = GetContainer(kShellWindowId_ShelfContainer); |
828 shelf_container->SetEventTargeter(base::MakeUnique<ShelfWindowTargeter>( | 828 shelf_container->SetEventTargeter( |
829 WmWindow::Get(shelf_container), shelf_.get())); | 829 base::MakeUnique<ShelfWindowTargeter>(shelf_container, shelf_.get())); |
830 aura::Window* status_container = GetContainer(kShellWindowId_StatusContainer); | 830 aura::Window* status_container = GetContainer(kShellWindowId_StatusContainer); |
831 status_container->SetEventTargeter(base::MakeUnique<ShelfWindowTargeter>( | 831 status_container->SetEventTargeter( |
832 WmWindow::Get(status_container), shelf_.get())); | 832 base::MakeUnique<ShelfWindowTargeter>(status_container, shelf_.get())); |
833 | 833 |
834 panel_container_handler_ = base::MakeUnique<PanelWindowEventHandler>(); | 834 panel_container_handler_ = base::MakeUnique<PanelWindowEventHandler>(); |
835 GetContainer(kShellWindowId_PanelContainer) | 835 GetContainer(kShellWindowId_PanelContainer) |
836 ->AddPreTargetHandler(panel_container_handler_.get()); | 836 ->AddPreTargetHandler(panel_container_handler_.get()); |
837 | 837 |
838 // Install an AttachedPanelWindowTargeter on the panel container to make it | 838 // Install an AttachedPanelWindowTargeter on the panel container to make it |
839 // easier to correctly target shelf buttons with touch. | 839 // easier to correctly target shelf buttons with touch. |
840 gfx::Insets mouse_extend(-kResizeOutsideBoundsSize, -kResizeOutsideBoundsSize, | 840 gfx::Insets mouse_extend(-kResizeOutsideBoundsSize, -kResizeOutsideBoundsSize, |
841 -kResizeOutsideBoundsSize, | 841 -kResizeOutsideBoundsSize, |
842 -kResizeOutsideBoundsSize); | 842 -kResizeOutsideBoundsSize); |
843 gfx::Insets touch_extend = | 843 gfx::Insets touch_extend = |
844 mouse_extend.Scale(kResizeOutsideBoundsScaleForTouch); | 844 mouse_extend.Scale(kResizeOutsideBoundsScaleForTouch); |
845 panel_container->SetEventTargeter(std::unique_ptr<ui::EventTargeter>( | 845 panel_container->SetEventTargeter(std::unique_ptr<ui::EventTargeter>( |
846 new AttachedPanelWindowTargeter(panel_container, mouse_extend, | 846 new AttachedPanelWindowTargeter(panel_container, mouse_extend, |
847 touch_extend, panel_layout_manager()))); | 847 touch_extend, panel_layout_manager()))); |
848 } | 848 } |
849 | 849 |
850 void RootWindowController::CreateContainers() { | 850 void RootWindowController::CreateContainers() { |
851 WmWindow* root = GetWindow(); | 851 aura::Window* root = GetRootWindow(); |
852 // For screen rotation animation: add a NOT_DRAWN layer in between the | 852 // For screen rotation animation: add a NOT_DRAWN layer in between the |
853 // root_window's layer and its current children so that we only need to | 853 // root_window's layer and its current children so that we only need to |
854 // initiate two LayerAnimationSequences. One for the new layers and one for | 854 // initiate two LayerAnimationSequences. One for the new layers and one for |
855 // the old layers. | 855 // the old layers. |
856 WmWindow* screen_rotation_container = CreateContainer( | 856 aura::Window* screen_rotation_container = CreateContainer( |
857 kShellWindowId_ScreenRotationContainer, "ScreenRotationContainer", root); | 857 kShellWindowId_ScreenRotationContainer, "ScreenRotationContainer", root); |
858 | 858 |
859 // These containers are just used by PowerButtonController to animate groups | 859 // These containers are just used by PowerButtonController to animate groups |
860 // of containers simultaneously without messing up the current transformations | 860 // of containers simultaneously without messing up the current transformations |
861 // on those containers. These are direct children of the | 861 // on those containers. These are direct children of the |
862 // screen_rotation_container window; all of the other containers are their | 862 // screen_rotation_container window; all of the other containers are their |
863 // children. | 863 // children. |
864 | 864 |
865 // The wallpaper container is not part of the lock animation, so it is not | 865 // The wallpaper container is not part of the lock animation, so it is not |
866 // included in those animate groups. When the screen is locked, the wallpaper | 866 // included in those animate groups. When the screen is locked, the wallpaper |
867 // is moved to the lock screen wallpaper container (and moved back on unlock). | 867 // is moved to the lock screen wallpaper container (and moved back on unlock). |
868 // Ensure that there's an opaque layer occluding the non-lock-screen layers. | 868 // Ensure that there's an opaque layer occluding the non-lock-screen layers. |
869 WmWindow* wallpaper_container = | 869 aura::Window* wallpaper_container = |
870 CreateContainer(kShellWindowId_WallpaperContainer, "WallpaperContainer", | 870 CreateContainer(kShellWindowId_WallpaperContainer, "WallpaperContainer", |
871 screen_rotation_container); | 871 screen_rotation_container); |
872 wallpaper_container->SetChildWindowVisibilityChangesAnimated(); | 872 ::wm::SetChildWindowVisibilityChangesAnimated(wallpaper_container); |
873 | 873 |
874 WmWindow* non_lock_screen_containers = CreateContainer( | 874 aura::Window* non_lock_screen_containers = CreateContainer( |
875 kShellWindowId_NonLockScreenContainersContainer, | 875 kShellWindowId_NonLockScreenContainersContainer, |
876 "NonLockScreenContainersContainer", screen_rotation_container); | 876 "NonLockScreenContainersContainer", screen_rotation_container); |
877 // Clip all windows inside this container, as half pixel of the window's | 877 // Clip all windows inside this container, as half pixel of the window's |
878 // texture may become visible when the screen is scaled. crbug.com/368591. | 878 // texture may become visible when the screen is scaled. crbug.com/368591. |
879 non_lock_screen_containers->SetMasksToBounds(true); | 879 non_lock_screen_containers->layer()->SetMasksToBounds(true); |
880 | 880 |
881 WmWindow* lock_wallpaper_containers = CreateContainer( | 881 aura::Window* lock_wallpaper_containers = CreateContainer( |
882 kShellWindowId_LockScreenWallpaperContainer, | 882 kShellWindowId_LockScreenWallpaperContainer, |
883 "LockScreenWallpaperContainer", screen_rotation_container); | 883 "LockScreenWallpaperContainer", screen_rotation_container); |
884 lock_wallpaper_containers->SetChildWindowVisibilityChangesAnimated(); | 884 ::wm::SetChildWindowVisibilityChangesAnimated(lock_wallpaper_containers); |
885 | 885 |
886 WmWindow* lock_screen_containers = CreateContainer( | 886 aura::Window* lock_screen_containers = CreateContainer( |
887 kShellWindowId_LockScreenContainersContainer, | 887 kShellWindowId_LockScreenContainersContainer, |
888 "LockScreenContainersContainer", screen_rotation_container); | 888 "LockScreenContainersContainer", screen_rotation_container); |
889 WmWindow* lock_screen_related_containers = CreateContainer( | 889 aura::Window* lock_screen_related_containers = CreateContainer( |
890 kShellWindowId_LockScreenRelatedContainersContainer, | 890 kShellWindowId_LockScreenRelatedContainersContainer, |
891 "LockScreenRelatedContainersContainer", screen_rotation_container); | 891 "LockScreenRelatedContainersContainer", screen_rotation_container); |
892 | 892 |
893 CreateContainer(kShellWindowId_UnparentedControlContainer, | 893 CreateContainer(kShellWindowId_UnparentedControlContainer, |
894 "UnparentedControlContainer", non_lock_screen_containers); | 894 "UnparentedControlContainer", non_lock_screen_containers); |
895 | 895 |
896 WmWindow* default_container = | 896 aura::Window* default_container = |
897 CreateContainer(kShellWindowId_DefaultContainer, "DefaultContainer", | 897 CreateContainer(kShellWindowId_DefaultContainer, "DefaultContainer", |
898 non_lock_screen_containers); | 898 non_lock_screen_containers); |
899 default_container->SetChildWindowVisibilityChangesAnimated(); | 899 ::wm::SetChildWindowVisibilityChangesAnimated(default_container); |
900 default_container->SetSnapsChildrenToPhysicalPixelBoundary(); | 900 wm::SetSnapsChildrenToPhysicalPixelBoundary(default_container); |
901 default_container->SetBoundsInScreenBehaviorForChildren( | 901 default_container->SetProperty(kUsesScreenCoordinatesKey, true); |
902 WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES); | 902 wm::SetChildrenUseExtendedHitRegionForWindow(default_container); |
903 default_container->SetChildrenUseExtendedHitRegion(); | |
904 | 903 |
905 WmWindow* always_on_top_container = | 904 aura::Window* always_on_top_container = |
906 CreateContainer(kShellWindowId_AlwaysOnTopContainer, | 905 CreateContainer(kShellWindowId_AlwaysOnTopContainer, |
907 "AlwaysOnTopContainer", non_lock_screen_containers); | 906 "AlwaysOnTopContainer", non_lock_screen_containers); |
908 always_on_top_container->SetChildWindowVisibilityChangesAnimated(); | 907 ::wm::SetChildWindowVisibilityChangesAnimated(always_on_top_container); |
909 always_on_top_container->SetSnapsChildrenToPhysicalPixelBoundary(); | 908 wm::SetSnapsChildrenToPhysicalPixelBoundary(always_on_top_container); |
910 always_on_top_container->SetBoundsInScreenBehaviorForChildren( | 909 always_on_top_container->SetProperty(kUsesScreenCoordinatesKey, true); |
911 WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES); | |
912 | 910 |
913 WmWindow* shelf_container = | 911 aura::Window* shelf_container = |
914 CreateContainer(kShellWindowId_ShelfContainer, "ShelfContainer", | 912 CreateContainer(kShellWindowId_ShelfContainer, "ShelfContainer", |
915 non_lock_screen_containers); | 913 non_lock_screen_containers); |
916 shelf_container->SetSnapsChildrenToPhysicalPixelBoundary(); | 914 wm::SetSnapsChildrenToPhysicalPixelBoundary(shelf_container); |
917 shelf_container->SetBoundsInScreenBehaviorForChildren( | 915 shelf_container->SetProperty(kUsesScreenCoordinatesKey, true); |
918 WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES); | 916 shelf_container->SetProperty(kLockedToRootKey, true); |
919 shelf_container->SetLockedToRoot(true); | |
920 | 917 |
921 WmWindow* panel_container = | 918 aura::Window* panel_container = |
922 CreateContainer(kShellWindowId_PanelContainer, "PanelContainer", | 919 CreateContainer(kShellWindowId_PanelContainer, "PanelContainer", |
923 non_lock_screen_containers); | 920 non_lock_screen_containers); |
924 panel_container->SetSnapsChildrenToPhysicalPixelBoundary(); | 921 wm::SetSnapsChildrenToPhysicalPixelBoundary(panel_container); |
925 panel_container->SetBoundsInScreenBehaviorForChildren( | 922 panel_container->SetProperty(kUsesScreenCoordinatesKey, true); |
926 WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES); | |
927 | 923 |
928 WmWindow* shelf_bubble_container = | 924 aura::Window* shelf_bubble_container = |
929 CreateContainer(kShellWindowId_ShelfBubbleContainer, | 925 CreateContainer(kShellWindowId_ShelfBubbleContainer, |
930 "ShelfBubbleContainer", non_lock_screen_containers); | 926 "ShelfBubbleContainer", non_lock_screen_containers); |
931 shelf_bubble_container->SetSnapsChildrenToPhysicalPixelBoundary(); | 927 wm::SetSnapsChildrenToPhysicalPixelBoundary(shelf_bubble_container); |
932 shelf_bubble_container->SetBoundsInScreenBehaviorForChildren( | 928 shelf_bubble_container->SetProperty(kUsesScreenCoordinatesKey, true); |
933 WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES); | 929 shelf_bubble_container->SetProperty(kLockedToRootKey, true); |
934 shelf_bubble_container->SetLockedToRoot(true); | |
935 | 930 |
936 WmWindow* app_list_container = | 931 aura::Window* app_list_container = |
937 CreateContainer(kShellWindowId_AppListContainer, "AppListContainer", | 932 CreateContainer(kShellWindowId_AppListContainer, "AppListContainer", |
938 non_lock_screen_containers); | 933 non_lock_screen_containers); |
939 app_list_container->SetSnapsChildrenToPhysicalPixelBoundary(); | 934 wm::SetSnapsChildrenToPhysicalPixelBoundary(app_list_container); |
940 app_list_container->SetBoundsInScreenBehaviorForChildren( | 935 app_list_container->SetProperty(kUsesScreenCoordinatesKey, true); |
941 WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES); | |
942 | 936 |
943 WmWindow* modal_container = | 937 aura::Window* modal_container = |
944 CreateContainer(kShellWindowId_SystemModalContainer, | 938 CreateContainer(kShellWindowId_SystemModalContainer, |
945 "SystemModalContainer", non_lock_screen_containers); | 939 "SystemModalContainer", non_lock_screen_containers); |
946 modal_container->SetSnapsChildrenToPhysicalPixelBoundary(); | 940 wm::SetSnapsChildrenToPhysicalPixelBoundary(modal_container); |
947 modal_container->SetChildWindowVisibilityChangesAnimated(); | 941 ::wm::SetChildWindowVisibilityChangesAnimated(modal_container); |
948 modal_container->SetBoundsInScreenBehaviorForChildren( | 942 modal_container->SetProperty(kUsesScreenCoordinatesKey, true); |
949 WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES); | 943 wm::SetChildrenUseExtendedHitRegionForWindow(modal_container); |
950 modal_container->SetChildrenUseExtendedHitRegion(); | |
951 | 944 |
952 // TODO(beng): Figure out if we can make this use | 945 // TODO(beng): Figure out if we can make this use |
953 // SystemModalContainerEventFilter instead of stops_event_propagation. | 946 // SystemModalContainerEventFilter instead of stops_event_propagation. |
954 WmWindow* lock_container = | 947 aura::Window* lock_container = |
955 CreateContainer(kShellWindowId_LockScreenContainer, "LockScreenContainer", | 948 CreateContainer(kShellWindowId_LockScreenContainer, "LockScreenContainer", |
956 lock_screen_containers); | 949 lock_screen_containers); |
957 lock_container->SetSnapsChildrenToPhysicalPixelBoundary(); | 950 wm::SetSnapsChildrenToPhysicalPixelBoundary(lock_container); |
958 lock_container->SetBoundsInScreenBehaviorForChildren( | 951 lock_container->SetProperty(kUsesScreenCoordinatesKey, true); |
959 WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES); | |
960 // TODO(beng): stopsevents | 952 // TODO(beng): stopsevents |
961 | 953 |
962 WmWindow* lock_action_handler_container = | 954 aura::Window* lock_action_handler_container = |
963 CreateContainer(kShellWindowId_LockActionHandlerContainer, | 955 CreateContainer(kShellWindowId_LockActionHandlerContainer, |
964 "LockActionHandlerContainer", lock_screen_containers); | 956 "LockActionHandlerContainer", lock_screen_containers); |
965 lock_action_handler_container->SetSnapsChildrenToPhysicalPixelBoundary(); | 957 wm::SetSnapsChildrenToPhysicalPixelBoundary(lock_action_handler_container); |
966 lock_action_handler_container->SetChildWindowVisibilityChangesAnimated(); | 958 ::wm::SetChildWindowVisibilityChangesAnimated(lock_action_handler_container); |
967 lock_action_handler_container->SetBoundsInScreenBehaviorForChildren( | 959 lock_action_handler_container->SetProperty(kUsesScreenCoordinatesKey, true); |
968 WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES); | |
969 | 960 |
970 WmWindow* lock_modal_container = | 961 aura::Window* lock_modal_container = |
971 CreateContainer(kShellWindowId_LockSystemModalContainer, | 962 CreateContainer(kShellWindowId_LockSystemModalContainer, |
972 "LockSystemModalContainer", lock_screen_containers); | 963 "LockSystemModalContainer", lock_screen_containers); |
973 lock_modal_container->SetSnapsChildrenToPhysicalPixelBoundary(); | 964 wm::SetSnapsChildrenToPhysicalPixelBoundary(lock_modal_container); |
974 lock_modal_container->SetChildWindowVisibilityChangesAnimated(); | 965 ::wm::SetChildWindowVisibilityChangesAnimated(lock_modal_container); |
975 lock_modal_container->SetBoundsInScreenBehaviorForChildren( | 966 lock_modal_container->SetProperty(kUsesScreenCoordinatesKey, true); |
976 WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES); | 967 wm::SetChildrenUseExtendedHitRegionForWindow(lock_modal_container); |
977 lock_modal_container->SetChildrenUseExtendedHitRegion(); | |
978 | 968 |
979 WmWindow* status_container = | 969 aura::Window* status_container = |
980 CreateContainer(kShellWindowId_StatusContainer, "StatusContainer", | 970 CreateContainer(kShellWindowId_StatusContainer, "StatusContainer", |
981 lock_screen_related_containers); | 971 lock_screen_related_containers); |
982 status_container->SetSnapsChildrenToPhysicalPixelBoundary(); | 972 wm::SetSnapsChildrenToPhysicalPixelBoundary(status_container); |
983 status_container->SetBoundsInScreenBehaviorForChildren( | 973 status_container->SetProperty(kUsesScreenCoordinatesKey, true); |
984 WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES); | 974 status_container->SetProperty(kLockedToRootKey, true); |
985 status_container->SetLockedToRoot(true); | |
986 | 975 |
987 WmWindow* settings_bubble_container = | 976 aura::Window* settings_bubble_container = |
988 CreateContainer(kShellWindowId_SettingBubbleContainer, | 977 CreateContainer(kShellWindowId_SettingBubbleContainer, |
989 "SettingBubbleContainer", lock_screen_related_containers); | 978 "SettingBubbleContainer", lock_screen_related_containers); |
990 settings_bubble_container->SetChildWindowVisibilityChangesAnimated(); | 979 ::wm::SetChildWindowVisibilityChangesAnimated(settings_bubble_container); |
991 settings_bubble_container->SetSnapsChildrenToPhysicalPixelBoundary(); | 980 wm::SetSnapsChildrenToPhysicalPixelBoundary(settings_bubble_container); |
992 settings_bubble_container->SetBoundsInScreenBehaviorForChildren( | 981 settings_bubble_container->SetProperty(kUsesScreenCoordinatesKey, true); |
993 WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES); | 982 settings_bubble_container->SetProperty(kLockedToRootKey, true); |
994 settings_bubble_container->SetLockedToRoot(true); | |
995 | 983 |
996 WmWindow* virtual_keyboard_parent_container = CreateContainer( | 984 aura::Window* virtual_keyboard_parent_container = CreateContainer( |
997 kShellWindowId_ImeWindowParentContainer, "VirtualKeyboardParentContainer", | 985 kShellWindowId_ImeWindowParentContainer, "VirtualKeyboardParentContainer", |
998 lock_screen_related_containers); | 986 lock_screen_related_containers); |
999 virtual_keyboard_parent_container->SetSnapsChildrenToPhysicalPixelBoundary(); | 987 wm::SetSnapsChildrenToPhysicalPixelBoundary( |
1000 virtual_keyboard_parent_container->SetBoundsInScreenBehaviorForChildren( | 988 virtual_keyboard_parent_container); |
1001 WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES); | 989 virtual_keyboard_parent_container->SetProperty(kUsesScreenCoordinatesKey, |
| 990 true); |
1002 | 991 |
1003 WmWindow* menu_container = | 992 aura::Window* menu_container = |
1004 CreateContainer(kShellWindowId_MenuContainer, "MenuContainer", | 993 CreateContainer(kShellWindowId_MenuContainer, "MenuContainer", |
1005 lock_screen_related_containers); | 994 lock_screen_related_containers); |
1006 menu_container->SetChildWindowVisibilityChangesAnimated(); | 995 ::wm::SetChildWindowVisibilityChangesAnimated(menu_container); |
1007 menu_container->SetSnapsChildrenToPhysicalPixelBoundary(); | 996 wm::SetSnapsChildrenToPhysicalPixelBoundary(menu_container); |
1008 menu_container->SetBoundsInScreenBehaviorForChildren( | 997 menu_container->SetProperty(kUsesScreenCoordinatesKey, true); |
1009 WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES); | |
1010 | 998 |
1011 WmWindow* drag_drop_container = CreateContainer( | 999 aura::Window* drag_drop_container = CreateContainer( |
1012 kShellWindowId_DragImageAndTooltipContainer, | 1000 kShellWindowId_DragImageAndTooltipContainer, |
1013 "DragImageAndTooltipContainer", lock_screen_related_containers); | 1001 "DragImageAndTooltipContainer", lock_screen_related_containers); |
1014 drag_drop_container->SetChildWindowVisibilityChangesAnimated(); | 1002 ::wm::SetChildWindowVisibilityChangesAnimated(drag_drop_container); |
1015 drag_drop_container->SetSnapsChildrenToPhysicalPixelBoundary(); | 1003 wm::SetSnapsChildrenToPhysicalPixelBoundary(drag_drop_container); |
1016 drag_drop_container->SetBoundsInScreenBehaviorForChildren( | 1004 drag_drop_container->SetProperty(kUsesScreenCoordinatesKey, true); |
1017 WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES); | |
1018 | 1005 |
1019 WmWindow* overlay_container = | 1006 aura::Window* overlay_container = |
1020 CreateContainer(kShellWindowId_OverlayContainer, "OverlayContainer", | 1007 CreateContainer(kShellWindowId_OverlayContainer, "OverlayContainer", |
1021 lock_screen_related_containers); | 1008 lock_screen_related_containers); |
1022 overlay_container->SetSnapsChildrenToPhysicalPixelBoundary(); | 1009 wm::SetSnapsChildrenToPhysicalPixelBoundary(overlay_container); |
1023 overlay_container->SetBoundsInScreenBehaviorForChildren( | 1010 overlay_container->SetProperty(kUsesScreenCoordinatesKey, true); |
1024 WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES); | |
1025 | 1011 |
1026 WmWindow* mouse_cursor_container = | 1012 aura::Window* mouse_cursor_container = |
1027 CreateContainer(kShellWindowId_MouseCursorContainer, | 1013 CreateContainer(kShellWindowId_MouseCursorContainer, |
1028 "MouseCursorContainer", screen_rotation_container); | 1014 "MouseCursorContainer", screen_rotation_container); |
1029 mouse_cursor_container->SetBoundsInScreenBehaviorForChildren( | 1015 mouse_cursor_container->SetProperty(kUsesScreenCoordinatesKey, true); |
1030 WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES); | |
1031 | 1016 |
1032 CreateContainer(kShellWindowId_PowerButtonAnimationContainer, | 1017 CreateContainer(kShellWindowId_PowerButtonAnimationContainer, |
1033 "PowerButtonAnimationContainer", screen_rotation_container); | 1018 "PowerButtonAnimationContainer", screen_rotation_container); |
1034 } | 1019 } |
1035 | 1020 |
1036 void RootWindowController::CreateSystemWallpaper( | 1021 void RootWindowController::CreateSystemWallpaper( |
1037 RootWindowType root_window_type) { | 1022 RootWindowType root_window_type) { |
1038 SkColor color = SK_ColorBLACK; | 1023 SkColor color = SK_ColorBLACK; |
1039 // The splash screen appears on the primary display at boot. If this is a | 1024 // 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 | 1025 // secondary monitor (either connected at boot or connected later) or if the |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1097 EnableTouchHudProjection(); | 1082 EnableTouchHudProjection(); |
1098 else | 1083 else |
1099 DisableTouchHudProjection(); | 1084 DisableTouchHudProjection(); |
1100 } | 1085 } |
1101 | 1086 |
1102 RootWindowController* GetRootWindowController(const aura::Window* root_window) { | 1087 RootWindowController* GetRootWindowController(const aura::Window* root_window) { |
1103 return root_window ? GetRootWindowSettings(root_window)->controller : nullptr; | 1088 return root_window ? GetRootWindowSettings(root_window)->controller : nullptr; |
1104 } | 1089 } |
1105 | 1090 |
1106 } // namespace ash | 1091 } // namespace ash |
OLD | NEW |