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

Side by Side Diff: ash/root_window_controller.cc

Issue 2024993002: Makes RootWindowController window creation in terms of common types (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge 2 trunk Created 4 years, 6 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/root_window_controller.h ('k') | ash/shell.h » ('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 <queue> 7 #include <queue>
8 #include <vector> 8 #include <vector>
9 9
10 #include "ash/ash_constants.h" 10 #include "ash/ash_constants.h"
(...skipping 23 matching lines...) Expand all
34 #include "ash/wm/aura/aura_layout_manager_adapter.h" 34 #include "ash/wm/aura/aura_layout_manager_adapter.h"
35 #include "ash/wm/aura/wm_shelf_aura.h" 35 #include "ash/wm/aura/wm_shelf_aura.h"
36 #include "ash/wm/aura/wm_window_aura.h" 36 #include "ash/wm/aura/wm_window_aura.h"
37 #include "ash/wm/common/always_on_top_controller.h" 37 #include "ash/wm/common/always_on_top_controller.h"
38 #include "ash/wm/common/container_finder.h" 38 #include "ash/wm/common/container_finder.h"
39 #include "ash/wm/common/dock/docked_window_layout_manager.h" 39 #include "ash/wm/common/dock/docked_window_layout_manager.h"
40 #include "ash/wm/common/fullscreen_window_finder.h" 40 #include "ash/wm/common/fullscreen_window_finder.h"
41 #include "ash/wm/common/panels/panel_layout_manager.h" 41 #include "ash/wm/common/panels/panel_layout_manager.h"
42 #include "ash/wm/common/switchable_windows.h" 42 #include "ash/wm/common/switchable_windows.h"
43 #include "ash/wm/common/window_state.h" 43 #include "ash/wm/common/window_state.h"
44 #include "ash/wm/common/wm_globals.h"
45 #include "ash/wm/common/wm_window.h"
44 #include "ash/wm/common/workspace/workspace_layout_manager.h" 46 #include "ash/wm/common/workspace/workspace_layout_manager.h"
45 #include "ash/wm/common/workspace/workspace_layout_manager_delegate.h" 47 #include "ash/wm/common/workspace/workspace_layout_manager_delegate.h"
46 #include "ash/wm/lock_layout_manager.h" 48 #include "ash/wm/lock_layout_manager.h"
47 #include "ash/wm/panels/attached_panel_window_targeter.h" 49 #include "ash/wm/panels/attached_panel_window_targeter.h"
48 #include "ash/wm/panels/panel_window_event_handler.h" 50 #include "ash/wm/panels/panel_window_event_handler.h"
49 #include "ash/wm/root_window_layout_manager.h" 51 #include "ash/wm/root_window_layout_manager.h"
50 #include "ash/wm/stacking_controller.h" 52 #include "ash/wm/stacking_controller.h"
51 #include "ash/wm/status_area_layout_manager.h" 53 #include "ash/wm/status_area_layout_manager.h"
52 #include "ash/wm/system_background_controller.h" 54 #include "ash/wm/system_background_controller.h"
53 #include "ash/wm/system_modal_container_layout_manager.h" 55 #include "ash/wm/system_modal_container_layout_manager.h"
(...skipping 16 matching lines...) Expand all
70 #include "ui/base/models/menu_model.h" 72 #include "ui/base/models/menu_model.h"
71 #include "ui/display/display.h" 73 #include "ui/display/display.h"
72 #include "ui/display/screen.h" 74 #include "ui/display/screen.h"
73 #include "ui/keyboard/keyboard_controller.h" 75 #include "ui/keyboard/keyboard_controller.h"
74 #include "ui/keyboard/keyboard_util.h" 76 #include "ui/keyboard/keyboard_util.h"
75 #include "ui/views/controls/menu/menu_model_adapter.h" 77 #include "ui/views/controls/menu/menu_model_adapter.h"
76 #include "ui/views/controls/menu/menu_runner.h" 78 #include "ui/views/controls/menu/menu_runner.h"
77 #include "ui/views/view_model.h" 79 #include "ui/views/view_model.h"
78 #include "ui/views/view_model_utils.h" 80 #include "ui/views/view_model_utils.h"
79 #include "ui/wm/core/capture_controller.h" 81 #include "ui/wm/core/capture_controller.h"
80 #include "ui/wm/core/easy_resize_window_targeter.h"
81 #include "ui/wm/core/visibility_controller.h" 82 #include "ui/wm/core/visibility_controller.h"
82 #include "ui/wm/core/window_util.h" 83 #include "ui/wm/core/window_util.h"
83 #include "ui/wm/public/drag_drop_client.h" 84 #include "ui/wm/public/drag_drop_client.h"
84 #include "ui/wm/public/tooltip_client.h" 85 #include "ui/wm/public/tooltip_client.h"
85 #include "ui/wm/public/window_types.h" 86 #include "ui/wm/public/window_types.h"
86 87
87 #if defined(OS_CHROMEOS) 88 #if defined(OS_CHROMEOS)
88 #include "ash/ash_touch_exploration_manager_chromeos.h" 89 #include "ash/ash_touch_exploration_manager_chromeos.h"
89 #include "ash/wm/boot_splash_screen_chromeos.h" 90 #include "ash/wm/boot_splash_screen_chromeos.h"
90 #include "ui/chromeos/touch_exploration_controller.h" 91 #include "ui/chromeos/touch_exploration_controller.h"
91 #endif 92 #endif
92 93
93 namespace ash { 94 namespace ash {
94 namespace { 95 namespace {
95 96
96 #if defined(OS_CHROMEOS) 97 #if defined(OS_CHROMEOS)
97 // Duration for the animation that hides the boot splash screen, in 98 // Duration for the animation that hides the boot splash screen, in
98 // milliseconds. This should be short enough in relation to 99 // milliseconds. This should be short enough in relation to
99 // wm/window_animation.cc's brightness/grayscale fade animation that the login 100 // wm/window_animation.cc's brightness/grayscale fade animation that the login
100 // background image animation isn't hidden by the splash screen animation. 101 // background image animation isn't hidden by the splash screen animation.
101 const int kBootSplashScreenHideDurationMs = 500; 102 const int kBootSplashScreenHideDurationMs = 500;
102 #endif 103 #endif
103 104
104 // Creates a new window for use as a container. 105 // Creates a new window for use as a container.
105 aura::Window* CreateContainer(int window_id, 106 wm::WmWindow* CreateContainer(int window_id,
106 const char* name, 107 const char* name,
107 aura::Window* parent) { 108 wm::WmWindow* parent) {
108 aura::Window* container = new aura::Window(NULL); 109 wm::WmWindow* window = wm::WmGlobals::Get()->NewContainerWindow();
109 container->set_id(window_id); 110 window->SetShellWindowId(window_id);
110 container->SetName(name); 111 window->SetName(name);
111 container->Init(ui::LAYER_NOT_DRAWN); 112 parent->AddChild(window);
112 parent->AddChild(container);
113 if (window_id != kShellWindowId_UnparentedControlContainer) 113 if (window_id != kShellWindowId_UnparentedControlContainer)
114 container->Show(); 114 window->Show();
115 return container; 115 return window;
116 } 116 }
117 117
118 float ToRelativeValue(int value, int src, int dst) { 118 float ToRelativeValue(int value, int src, int dst) {
119 return static_cast<float>(value) / static_cast<float>(src) * dst; 119 return static_cast<float>(value) / static_cast<float>(src) * dst;
120 } 120 }
121 121
122 void MoveOriginRelativeToSize(const gfx::Size& src_size, 122 void MoveOriginRelativeToSize(const gfx::Size& src_size,
123 const gfx::Size& dst_size, 123 const gfx::Size& dst_size,
124 gfx::Rect* bounds_in_out) { 124 gfx::Rect* bounds_in_out) {
125 gfx::Point origin = bounds_in_out->origin(); 125 gfx::Point origin = bounds_in_out->origin();
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 ++iter; 202 ++iter;
203 } 203 }
204 // If the entire window list is modal background windows then stop. 204 // If the entire window list is modal background windows then stop.
205 if (iter == src_container->children().end()) 205 if (iter == src_container->children().end())
206 break; 206 break;
207 ReparentWindow(*iter, dst_container); 207 ReparentWindow(*iter, dst_container);
208 } 208 }
209 } 209 }
210 } 210 }
211 211
212 // Mark the container window so that a widget added to this container will
213 // use the virtual screeen coordinates instead of parent.
214 void SetUsesScreenCoordinates(aura::Window* container) {
215 container->SetProperty(kUsesScreenCoordinatesKey, true);
216 }
217
218 // Mark the container window so that a widget added to this container will
219 // say in the same root window regardless of the bounds specified.
220 void DescendantShouldStayInSameRootWindow(aura::Window* container) {
221 container->SetProperty(kStayInSameRootWindowKey, true);
222 }
223
224 void SetUsesEasyResizeTargeter(aura::Window* container) {
225 gfx::Insets mouse_extend(-kResizeOutsideBoundsSize,
226 -kResizeOutsideBoundsSize,
227 -kResizeOutsideBoundsSize,
228 -kResizeOutsideBoundsSize);
229 gfx::Insets touch_extend = mouse_extend.Scale(
230 kResizeOutsideBoundsScaleForTouch);
231 container->SetEventTargeter(
232 std::unique_ptr<ui::EventTargeter>(new ::wm::EasyResizeWindowTargeter(
233 container, mouse_extend, touch_extend)));
234 }
235
236 // A window delegate which does nothing. Used to create a window that 212 // A window delegate which does nothing. Used to create a window that
237 // is a event target, but do nothing. 213 // is a event target, but do nothing.
238 class EmptyWindowDelegate : public aura::WindowDelegate { 214 class EmptyWindowDelegate : public aura::WindowDelegate {
239 public: 215 public:
240 EmptyWindowDelegate() {} 216 EmptyWindowDelegate() {}
241 ~EmptyWindowDelegate() override {} 217 ~EmptyWindowDelegate() override {}
242 218
243 // aura::WindowDelegate overrides: 219 // aura::WindowDelegate overrides:
244 gfx::Size GetMinimumSize() const override { return gfx::Size(); } 220 gfx::Size GetMinimumSize() const override { return gfx::Size(); }
245 gfx::Size GetMaximumSize() const override { return gfx::Size(); } 221 gfx::Size GetMaximumSize() const override { return gfx::Size(); }
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after
698 aura::client::SetWindowTreeClient(root_window, stacking_controller_.get()); 674 aura::client::SetWindowTreeClient(root_window, stacking_controller_.get());
699 capture_client_.reset(new ::wm::ScopedCaptureClient(root_window)); 675 capture_client_.reset(new ::wm::ScopedCaptureClient(root_window));
700 } 676 }
701 677
702 void RootWindowController::Init(RootWindowType root_window_type, 678 void RootWindowController::Init(RootWindowType root_window_type,
703 bool first_run_after_boot) { 679 bool first_run_after_boot) {
704 aura::Window* root_window = GetRootWindow(); 680 aura::Window* root_window = GetRootWindow();
705 Shell* shell = Shell::GetInstance(); 681 Shell* shell = Shell::GetInstance();
706 shell->InitRootWindow(root_window); 682 shell->InitRootWindow(root_window);
707 683
708 CreateContainersInRootWindow(root_window); 684 CreateContainersInRootWindow(wm::WmWindowAura::Get(root_window));
709 685
710 CreateSystemBackground(first_run_after_boot); 686 CreateSystemBackground(first_run_after_boot);
711 687
712 InitLayoutManagers(); 688 InitLayoutManagers();
713 InitTouchHuds(); 689 InitTouchHuds();
714 690
715 if (Shell::GetPrimaryRootWindowController()-> 691 if (Shell::GetPrimaryRootWindowController()->
716 GetSystemModalLayoutManager(NULL)->has_modal_background()) { 692 GetSystemModalLayoutManager(NULL)->has_modal_background()) {
717 GetSystemModalLayoutManager(NULL)->CreateModalBackground(); 693 GetSystemModalLayoutManager(NULL)->CreateModalBackground();
718 } 694 }
(...skipping 25 matching lines...) Expand all
744 720
745 void RootWindowController::InitLayoutManagers() { 721 void RootWindowController::InitLayoutManagers() {
746 aura::Window* root_window = GetRootWindow(); 722 aura::Window* root_window = GetRootWindow();
747 root_window_layout_ = new RootWindowLayoutManager(root_window); 723 root_window_layout_ = new RootWindowLayoutManager(root_window);
748 root_window->SetLayoutManager(root_window_layout_); 724 root_window->SetLayoutManager(root_window_layout_);
749 725
750 aura::Window* default_container = 726 aura::Window* default_container =
751 GetContainer(kShellWindowId_DefaultContainer); 727 GetContainer(kShellWindowId_DefaultContainer);
752 // Workspace manager has its own layout managers. 728 // Workspace manager has its own layout managers.
753 729
730 aura::Window* modal_container =
731 root_window->GetChildById(kShellWindowId_SystemModalContainer);
732 DCHECK(modal_container);
733 modal_container->SetLayoutManager(
734 new SystemModalContainerLayoutManager(modal_container));
735
736 aura::Window* lock_container =
737 root_window->GetChildById(kShellWindowId_LockScreenContainer);
738 DCHECK(lock_container);
739 lock_container->SetLayoutManager(new LockLayoutManager(lock_container));
740
741 aura::Window* lock_modal_container =
742 root_window->GetChildById(kShellWindowId_LockSystemModalContainer);
743 DCHECK(lock_modal_container);
744 lock_modal_container->SetLayoutManager(
745 new SystemModalContainerLayoutManager(lock_modal_container));
746
754 WorkspaceLayoutManagerDelegateImpl* workspace_layout_manager_delegate = 747 WorkspaceLayoutManagerDelegateImpl* workspace_layout_manager_delegate =
755 new WorkspaceLayoutManagerDelegateImpl(root_window); 748 new WorkspaceLayoutManagerDelegateImpl(root_window);
756 workspace_controller_.reset(new WorkspaceController( 749 workspace_controller_.reset(new WorkspaceController(
757 default_container, base::WrapUnique(workspace_layout_manager_delegate))); 750 default_container, base::WrapUnique(workspace_layout_manager_delegate)));
758 751
759 wm::WmWindow* always_on_top_container = 752 wm::WmWindow* always_on_top_container =
760 wm::WmWindowAura::Get(GetContainer(kShellWindowId_AlwaysOnTopContainer)); 753 wm::WmWindowAura::Get(GetContainer(kShellWindowId_AlwaysOnTopContainer));
761 always_on_top_controller_.reset( 754 always_on_top_controller_.reset(
762 new AlwaysOnTopController(always_on_top_container)); 755 new AlwaysOnTopController(always_on_top_container));
763 756
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
839 if (is_first_run_after_boot && 832 if (is_first_run_after_boot &&
840 (base::CommandLine::ForCurrentProcess()->HasSwitch( 833 (base::CommandLine::ForCurrentProcess()->HasSwitch(
841 switches::kAshCopyHostBackgroundAtBoot) || 834 switches::kAshCopyHostBackgroundAtBoot) ||
842 base::CommandLine::ForCurrentProcess()->HasSwitch( 835 base::CommandLine::ForCurrentProcess()->HasSwitch(
843 switches::kAshAnimateFromBootSplashScreen))) 836 switches::kAshAnimateFromBootSplashScreen)))
844 boot_splash_screen_.reset(new BootSplashScreen(GetHost())); 837 boot_splash_screen_.reset(new BootSplashScreen(GetHost()));
845 #endif 838 #endif
846 } 839 }
847 840
848 void RootWindowController::CreateContainersInRootWindow( 841 void RootWindowController::CreateContainersInRootWindow(
849 aura::Window* root_window) { 842 wm::WmWindow* root_window) {
850 // These containers are just used by PowerButtonController to animate groups 843 // These containers are just used by PowerButtonController to animate groups
851 // of containers simultaneously without messing up the current transformations 844 // of containers simultaneously without messing up the current transformations
852 // on those containers. These are direct children of the root window; all of 845 // on those containers. These are direct children of the root window; all of
853 // the other containers are their children. 846 // the other containers are their children.
854 847
855 // The desktop background container is not part of the lock animation, so it 848 // The desktop background container is not part of the lock animation, so it
856 // is not included in those animate groups. 849 // is not included in those animate groups.
857 // When screen is locked desktop background is moved to lock screen background 850 // When screen is locked desktop background is moved to lock screen background
858 // container (moved back on unlock). We want to make sure that there's an 851 // container (moved back on unlock). We want to make sure that there's an
859 // opaque layer occluding the non-lock-screen layers. 852 // opaque layer occluding the non-lock-screen layers.
860 aura::Window* desktop_background_container = CreateContainer( 853 wm::WmWindow* desktop_background_container =
861 kShellWindowId_DesktopBackgroundContainer, 854 CreateContainer(kShellWindowId_DesktopBackgroundContainer,
862 "DesktopBackgroundContainer", 855 "DesktopBackgroundContainer", root_window);
863 root_window); 856 desktop_background_container->SetChildWindowVisibilityChangesAnimated();
864 ::wm::SetChildWindowVisibilityChangesAnimated(desktop_background_container);
865 857
866 aura::Window* non_lock_screen_containers = CreateContainer( 858 wm::WmWindow* non_lock_screen_containers =
867 kShellWindowId_NonLockScreenContainersContainer, 859 CreateContainer(kShellWindowId_NonLockScreenContainersContainer,
868 "NonLockScreenContainersContainer", 860 "NonLockScreenContainersContainer", root_window);
869 root_window);
870 // Clip all windows inside this container, as half pixel of the window's 861 // Clip all windows inside this container, as half pixel of the window's
871 // texture may become visible when the screen is scaled. crbug.com/368591. 862 // texture may become visible when the screen is scaled. crbug.com/368591.
872 non_lock_screen_containers->layer()->SetMasksToBounds(true); 863 non_lock_screen_containers->SetMasksToBounds(true);
873 864
874 aura::Window* lock_background_containers = CreateContainer( 865 wm::WmWindow* lock_background_containers =
875 kShellWindowId_LockScreenBackgroundContainer, 866 CreateContainer(kShellWindowId_LockScreenBackgroundContainer,
876 "LockScreenBackgroundContainer", 867 "LockScreenBackgroundContainer", root_window);
877 root_window); 868 lock_background_containers->SetChildWindowVisibilityChangesAnimated();
878 ::wm::SetChildWindowVisibilityChangesAnimated(lock_background_containers);
879 869
880 aura::Window* lock_screen_containers = CreateContainer( 870 wm::WmWindow* lock_screen_containers =
881 kShellWindowId_LockScreenContainersContainer, 871 CreateContainer(kShellWindowId_LockScreenContainersContainer,
882 "LockScreenContainersContainer", 872 "LockScreenContainersContainer", root_window);
883 root_window); 873 wm::WmWindow* lock_screen_related_containers =
884 aura::Window* lock_screen_related_containers = CreateContainer( 874 CreateContainer(kShellWindowId_LockScreenRelatedContainersContainer,
885 kShellWindowId_LockScreenRelatedContainersContainer, 875 "LockScreenRelatedContainersContainer", root_window);
886 "LockScreenRelatedContainersContainer",
887 root_window);
888 876
889 CreateContainer(kShellWindowId_UnparentedControlContainer, 877 CreateContainer(kShellWindowId_UnparentedControlContainer,
890 "UnparentedControlContainer", 878 "UnparentedControlContainer",
891 non_lock_screen_containers); 879 non_lock_screen_containers);
892 880
893 aura::Window* default_container = CreateContainer( 881 wm::WmWindow* default_container =
894 kShellWindowId_DefaultContainer, 882 CreateContainer(kShellWindowId_DefaultContainer, "DefaultContainer",
895 "DefaultContainer", 883 non_lock_screen_containers);
896 non_lock_screen_containers); 884 default_container->SetChildWindowVisibilityChangesAnimated();
897 ::wm::SetChildWindowVisibilityChangesAnimated(default_container); 885 default_container->SetSnapsChildrenToPhysicalPixelBoundary();
898 wm::SetSnapsChildrenToPhysicalPixelBoundary(default_container); 886 default_container->SetBoundsInScreenBehaviorForChildren(
899 SetUsesScreenCoordinates(default_container); 887 wm::WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES);
900 SetUsesEasyResizeTargeter(default_container); 888 default_container->SetChildrenUseExtendedHitRegion();
901 889
902 aura::Window* always_on_top_container = CreateContainer( 890 wm::WmWindow* always_on_top_container =
903 kShellWindowId_AlwaysOnTopContainer, 891 CreateContainer(kShellWindowId_AlwaysOnTopContainer,
904 "AlwaysOnTopContainer", 892 "AlwaysOnTopContainer", non_lock_screen_containers);
905 non_lock_screen_containers); 893 always_on_top_container->SetChildWindowVisibilityChangesAnimated();
906 ::wm::SetChildWindowVisibilityChangesAnimated(always_on_top_container); 894 always_on_top_container->SetSnapsChildrenToPhysicalPixelBoundary();
907 wm::SetSnapsChildrenToPhysicalPixelBoundary(always_on_top_container); 895 always_on_top_container->SetBoundsInScreenBehaviorForChildren(
908 SetUsesScreenCoordinates(always_on_top_container); 896 wm::WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES);
909 897
910 aura::Window* docked_container = CreateContainer( 898 wm::WmWindow* docked_container =
911 kShellWindowId_DockedContainer, 899 CreateContainer(kShellWindowId_DockedContainer, "DockedContainer",
912 "DockedContainer", 900 non_lock_screen_containers);
913 non_lock_screen_containers); 901 docked_container->SetChildWindowVisibilityChangesAnimated();
914 ::wm::SetChildWindowVisibilityChangesAnimated(docked_container); 902 docked_container->SetSnapsChildrenToPhysicalPixelBoundary();
915 wm::SetSnapsChildrenToPhysicalPixelBoundary(docked_container); 903 docked_container->SetBoundsInScreenBehaviorForChildren(
916 SetUsesScreenCoordinates(docked_container); 904 wm::WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES);
917 SetUsesEasyResizeTargeter(docked_container); 905 docked_container->SetChildrenUseExtendedHitRegion();
918 906
919 aura::Window* shelf_container = 907 wm::WmWindow* shelf_container =
920 CreateContainer(kShellWindowId_ShelfContainer, 908 CreateContainer(kShellWindowId_ShelfContainer, "ShelfContainer",
921 "ShelfContainer",
922 non_lock_screen_containers); 909 non_lock_screen_containers);
923 wm::SetSnapsChildrenToPhysicalPixelBoundary(shelf_container); 910 shelf_container->SetSnapsChildrenToPhysicalPixelBoundary();
924 SetUsesScreenCoordinates(shelf_container); 911 shelf_container->SetBoundsInScreenBehaviorForChildren(
925 DescendantShouldStayInSameRootWindow(shelf_container); 912 wm::WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES);
913 shelf_container->SetDescendantsStayInSameRootWindow(true);
926 914
927 aura::Window* panel_container = CreateContainer( 915 wm::WmWindow* panel_container =
928 kShellWindowId_PanelContainer, 916 CreateContainer(kShellWindowId_PanelContainer, "PanelContainer",
929 "PanelContainer", 917 non_lock_screen_containers);
930 non_lock_screen_containers); 918 panel_container->SetSnapsChildrenToPhysicalPixelBoundary();
931 wm::SetSnapsChildrenToPhysicalPixelBoundary(panel_container); 919 panel_container->SetBoundsInScreenBehaviorForChildren(
932 SetUsesScreenCoordinates(panel_container); 920 wm::WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES);
933 921
934 aura::Window* shelf_bubble_container = 922 wm::WmWindow* shelf_bubble_container =
935 CreateContainer(kShellWindowId_ShelfBubbleContainer, 923 CreateContainer(kShellWindowId_ShelfBubbleContainer,
936 "ShelfBubbleContainer", 924 "ShelfBubbleContainer", non_lock_screen_containers);
925 shelf_bubble_container->SetSnapsChildrenToPhysicalPixelBoundary();
926 shelf_bubble_container->SetBoundsInScreenBehaviorForChildren(
927 wm::WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES);
928 shelf_bubble_container->SetDescendantsStayInSameRootWindow(true);
929
930 wm::WmWindow* app_list_container =
931 CreateContainer(kShellWindowId_AppListContainer, "AppListContainer",
937 non_lock_screen_containers); 932 non_lock_screen_containers);
938 wm::SetSnapsChildrenToPhysicalPixelBoundary(shelf_bubble_container); 933 app_list_container->SetSnapsChildrenToPhysicalPixelBoundary();
939 SetUsesScreenCoordinates(shelf_bubble_container); 934 app_list_container->SetBoundsInScreenBehaviorForChildren(
940 DescendantShouldStayInSameRootWindow(shelf_bubble_container); 935 wm::WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES);
941 936
942 aura::Window* app_list_container = 937 wm::WmWindow* modal_container =
943 CreateContainer(kShellWindowId_AppListContainer, 938 CreateContainer(kShellWindowId_SystemModalContainer,
944 "AppListContainer", 939 "SystemModalContainer", non_lock_screen_containers);
945 non_lock_screen_containers); 940 modal_container->SetSnapsChildrenToPhysicalPixelBoundary();
946 wm::SetSnapsChildrenToPhysicalPixelBoundary(app_list_container); 941 modal_container->SetChildWindowVisibilityChangesAnimated();
947 SetUsesScreenCoordinates(app_list_container); 942 modal_container->SetBoundsInScreenBehaviorForChildren(
948 943 wm::WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES);
949 aura::Window* modal_container = CreateContainer( 944 modal_container->SetChildrenUseExtendedHitRegion();
950 kShellWindowId_SystemModalContainer,
951 "SystemModalContainer",
952 non_lock_screen_containers);
953 wm::SetSnapsChildrenToPhysicalPixelBoundary(modal_container);
954 modal_container->SetLayoutManager(
955 new SystemModalContainerLayoutManager(modal_container));
956 ::wm::SetChildWindowVisibilityChangesAnimated(modal_container);
957 SetUsesScreenCoordinates(modal_container);
958 SetUsesEasyResizeTargeter(modal_container);
959 945
960 // TODO(beng): Figure out if we can make this use 946 // TODO(beng): Figure out if we can make this use
961 // SystemModalContainerEventFilter instead of stops_event_propagation. 947 // SystemModalContainerEventFilter instead of stops_event_propagation.
962 aura::Window* lock_container = CreateContainer( 948 wm::WmWindow* lock_container =
963 kShellWindowId_LockScreenContainer, 949 CreateContainer(kShellWindowId_LockScreenContainer, "LockScreenContainer",
964 "LockScreenContainer", 950 lock_screen_containers);
965 lock_screen_containers); 951 lock_container->SetSnapsChildrenToPhysicalPixelBoundary();
966 wm::SetSnapsChildrenToPhysicalPixelBoundary(lock_container); 952 lock_container->SetBoundsInScreenBehaviorForChildren(
967 lock_container->SetLayoutManager(new LockLayoutManager(lock_container)); 953 wm::WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES);
968 SetUsesScreenCoordinates(lock_container);
969 // TODO(beng): stopsevents 954 // TODO(beng): stopsevents
970 955
971 aura::Window* lock_modal_container = CreateContainer( 956 wm::WmWindow* lock_modal_container =
972 kShellWindowId_LockSystemModalContainer, 957 CreateContainer(kShellWindowId_LockSystemModalContainer,
973 "LockSystemModalContainer", 958 "LockSystemModalContainer", lock_screen_containers);
974 lock_screen_containers); 959 lock_modal_container->SetSnapsChildrenToPhysicalPixelBoundary();
975 wm::SetSnapsChildrenToPhysicalPixelBoundary(lock_modal_container); 960 lock_modal_container->SetChildWindowVisibilityChangesAnimated();
976 lock_modal_container->SetLayoutManager( 961 lock_modal_container->SetBoundsInScreenBehaviorForChildren(
977 new SystemModalContainerLayoutManager(lock_modal_container)); 962 wm::WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES);
978 ::wm::SetChildWindowVisibilityChangesAnimated(lock_modal_container); 963 lock_modal_container->SetChildrenUseExtendedHitRegion();
979 SetUsesScreenCoordinates(lock_modal_container);
980 SetUsesEasyResizeTargeter(lock_modal_container);
981 964
982 aura::Window* status_container = 965 wm::WmWindow* status_container =
983 CreateContainer(kShellWindowId_StatusContainer, 966 CreateContainer(kShellWindowId_StatusContainer, "StatusContainer",
984 "StatusContainer",
985 lock_screen_related_containers); 967 lock_screen_related_containers);
986 wm::SetSnapsChildrenToPhysicalPixelBoundary(status_container); 968 status_container->SetSnapsChildrenToPhysicalPixelBoundary();
987 SetUsesScreenCoordinates(status_container); 969 status_container->SetBoundsInScreenBehaviorForChildren(
988 DescendantShouldStayInSameRootWindow(status_container); 970 wm::WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES);
971 status_container->SetDescendantsStayInSameRootWindow(true);
989 972
990 aura::Window* settings_bubble_container = CreateContainer( 973 wm::WmWindow* settings_bubble_container =
991 kShellWindowId_SettingBubbleContainer, 974 CreateContainer(kShellWindowId_SettingBubbleContainer,
992 "SettingBubbleContainer", 975 "SettingBubbleContainer", lock_screen_related_containers);
976 settings_bubble_container->SetChildWindowVisibilityChangesAnimated();
977 settings_bubble_container->SetSnapsChildrenToPhysicalPixelBoundary();
978 settings_bubble_container->SetBoundsInScreenBehaviorForChildren(
979 wm::WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES);
980 settings_bubble_container->SetDescendantsStayInSameRootWindow(true);
981
982 wm::WmWindow* virtual_keyboard_parent_container = CreateContainer(
983 kShellWindowId_ImeWindowParentContainer, "VirtualKeyboardParentContainer",
993 lock_screen_related_containers); 984 lock_screen_related_containers);
994 ::wm::SetChildWindowVisibilityChangesAnimated(settings_bubble_container); 985 virtual_keyboard_parent_container->SetSnapsChildrenToPhysicalPixelBoundary();
995 wm::SetSnapsChildrenToPhysicalPixelBoundary(settings_bubble_container); 986 virtual_keyboard_parent_container->SetBoundsInScreenBehaviorForChildren(
996 SetUsesScreenCoordinates(settings_bubble_container); 987 wm::WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES);
997 DescendantShouldStayInSameRootWindow(settings_bubble_container);
998 988
999 aura::Window* virtual_keyboard_parent_container = 989 wm::WmWindow* menu_container =
1000 CreateContainer(kShellWindowId_ImeWindowParentContainer, 990 CreateContainer(kShellWindowId_MenuContainer, "MenuContainer",
1001 "VirtualKeyboardParentContainer",
1002 lock_screen_related_containers); 991 lock_screen_related_containers);
1003 wm::SetSnapsChildrenToPhysicalPixelBoundary( 992 menu_container->SetChildWindowVisibilityChangesAnimated();
1004 virtual_keyboard_parent_container); 993 menu_container->SetSnapsChildrenToPhysicalPixelBoundary();
1005 SetUsesScreenCoordinates(virtual_keyboard_parent_container); 994 menu_container->SetBoundsInScreenBehaviorForChildren(
995 wm::WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES);
1006 996
1007 aura::Window* menu_container = CreateContainer( 997 wm::WmWindow* drag_drop_container = CreateContainer(
1008 kShellWindowId_MenuContainer, 998 kShellWindowId_DragImageAndTooltipContainer,
1009 "MenuContainer", 999 "DragImageAndTooltipContainer", lock_screen_related_containers);
1010 lock_screen_related_containers); 1000 drag_drop_container->SetChildWindowVisibilityChangesAnimated();
1011 ::wm::SetChildWindowVisibilityChangesAnimated(menu_container); 1001 drag_drop_container->SetSnapsChildrenToPhysicalPixelBoundary();
1012 wm::SetSnapsChildrenToPhysicalPixelBoundary(menu_container); 1002 drag_drop_container->SetBoundsInScreenBehaviorForChildren(
1013 SetUsesScreenCoordinates(menu_container); 1003 wm::WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES);
1014 1004
1015 aura::Window* drag_drop_container = CreateContainer( 1005 wm::WmWindow* overlay_container =
1016 kShellWindowId_DragImageAndTooltipContainer, 1006 CreateContainer(kShellWindowId_OverlayContainer, "OverlayContainer",
1017 "DragImageAndTooltipContainer", 1007 lock_screen_related_containers);
1018 lock_screen_related_containers); 1008 overlay_container->SetSnapsChildrenToPhysicalPixelBoundary();
1019 ::wm::SetChildWindowVisibilityChangesAnimated(drag_drop_container); 1009 overlay_container->SetBoundsInScreenBehaviorForChildren(
1020 wm::SetSnapsChildrenToPhysicalPixelBoundary(drag_drop_container); 1010 wm::WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES);
1021 SetUsesScreenCoordinates(drag_drop_container);
1022
1023 aura::Window* overlay_container = CreateContainer(
1024 kShellWindowId_OverlayContainer,
1025 "OverlayContainer",
1026 lock_screen_related_containers);
1027 wm::SetSnapsChildrenToPhysicalPixelBoundary(overlay_container);
1028 SetUsesScreenCoordinates(overlay_container);
1029 1011
1030 #if defined(OS_CHROMEOS) 1012 #if defined(OS_CHROMEOS)
1031 aura::Window* mouse_cursor_container = CreateContainer( 1013 wm::WmWindow* mouse_cursor_container = CreateContainer(
1032 kShellWindowId_MouseCursorContainer, 1014 kShellWindowId_MouseCursorContainer, "MouseCursorContainer", root_window);
1033 "MouseCursorContainer", 1015 mouse_cursor_container->SetBoundsInScreenBehaviorForChildren(
1034 root_window); 1016 wm::WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES);
1035 SetUsesScreenCoordinates(mouse_cursor_container);
1036 #endif 1017 #endif
1037 1018
1038 CreateContainer(kShellWindowId_PowerButtonAnimationContainer, 1019 CreateContainer(kShellWindowId_PowerButtonAnimationContainer,
1039 "PowerButtonAnimationContainer", root_window); 1020 "PowerButtonAnimationContainer", root_window);
1040 } 1021 }
1041 1022
1042 void RootWindowController::EnableTouchHudProjection() { 1023 void RootWindowController::EnableTouchHudProjection() {
1043 if (touch_hud_projection_) 1024 if (touch_hud_projection_)
1044 return; 1025 return;
1045 set_touch_hud_projection(new TouchHudProjection(GetRootWindow())); 1026 set_touch_hud_projection(new TouchHudProjection(GetRootWindow()));
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
1083 aura::Window* primary_root_window = Shell::GetInstance() 1064 aura::Window* primary_root_window = Shell::GetInstance()
1084 ->window_tree_host_manager() 1065 ->window_tree_host_manager()
1085 ->GetPrimaryRootWindow(); 1066 ->GetPrimaryRootWindow();
1086 return GetRootWindowSettings(primary_root_window)->controller; 1067 return GetRootWindowSettings(primary_root_window)->controller;
1087 } 1068 }
1088 1069
1089 return GetRootWindowSettings(root_window)->controller; 1070 return GetRootWindowSettings(root_window)->controller;
1090 } 1071 }
1091 1072
1092 } // namespace ash 1073 } // namespace ash
OLDNEW
« no previous file with comments | « ash/root_window_controller.h ('k') | ash/shell.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698