Add per-day app launcher usage histogram
[chromium-blink-merge.git] / ash / root_window_controller.cc
blob3af8f489002c05f1b530354e6ab9b435037b7505
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
3 // found in the LICENSE file.
5 #include "ash/root_window_controller.h"
7 #include <vector>
9 #include "ash/ash_constants.h"
10 #include "ash/ash_switches.h"
11 #include "ash/desktop_background/desktop_background_widget_controller.h"
12 #include "ash/display/display_controller.h"
13 #include "ash/display/display_manager.h"
14 #include "ash/focus_cycler.h"
15 #include "ash/shelf/shelf_layout_manager.h"
16 #include "ash/shelf/shelf_types.h"
17 #include "ash/shelf/shelf_widget.h"
18 #include "ash/shell.h"
19 #include "ash/shell_delegate.h"
20 #include "ash/shell_factory.h"
21 #include "ash/shell_window_ids.h"
22 #include "ash/system/status_area_widget.h"
23 #include "ash/system/tray/system_tray_delegate.h"
24 #include "ash/touch/touch_observer_hud.h"
25 #include "ash/wm/base_layout_manager.h"
26 #include "ash/wm/boot_splash_screen.h"
27 #include "ash/wm/panels/panel_layout_manager.h"
28 #include "ash/wm/property_util.h"
29 #include "ash/wm/root_window_layout_manager.h"
30 #include "ash/wm/screen_dimmer.h"
31 #include "ash/wm/stacking_controller.h"
32 #include "ash/wm/status_area_layout_manager.h"
33 #include "ash/wm/system_background_controller.h"
34 #include "ash/wm/system_modal_container_layout_manager.h"
35 #include "ash/wm/toplevel_window_event_handler.h"
36 #include "ash/wm/window_properties.h"
37 #include "ash/wm/workspace_controller.h"
38 #include "base/command_line.h"
39 #include "base/time.h"
40 #include "ui/aura/client/activation_client.h"
41 #include "ui/aura/client/aura_constants.h"
42 #include "ui/aura/client/capture_client.h"
43 #include "ui/aura/client/focus_client.h"
44 #include "ui/aura/client/tooltip_client.h"
45 #include "ui/aura/root_window.h"
46 #include "ui/aura/window.h"
47 #include "ui/aura/window_observer.h"
48 #include "ui/aura/window_tracker.h"
49 #include "ui/base/models/menu_model.h"
50 #include "ui/gfx/display.h"
51 #include "ui/gfx/screen.h"
52 #include "ui/views/controls/menu/menu_runner.h"
53 #include "ui/views/corewm/visibility_controller.h"
54 #include "ui/views/view_model.h"
55 #include "ui/views/view_model_utils.h"
57 namespace ash {
58 namespace {
60 // Duration for the animation that hides the boot splash screen, in
61 // milliseconds. This should be short enough in relation to
62 // wm/window_animation.cc's brightness/grayscale fade animation that the login
63 // background image animation isn't hidden by the splash screen animation.
64 const int kBootSplashScreenHideDurationMs = 500;
66 // Creates a new window for use as a container.
67 aura::Window* CreateContainer(int window_id,
68 const char* name,
69 aura::Window* parent) {
70 aura::Window* container = new aura::Window(NULL);
71 container->set_id(window_id);
72 container->SetName(name);
73 container->Init(ui::LAYER_NOT_DRAWN);
74 parent->AddChild(container);
75 if (window_id != internal::kShellWindowId_UnparentedControlContainer)
76 container->Show();
77 return container;
80 // Returns all the children of the workspace windows, eg the standard top-level
81 // windows.
82 std::vector<aura::Window*> GetWorkspaceWindows(aura::RootWindow* root) {
83 using aura::Window;
85 std::vector<Window*> windows;
86 Window* container = Shell::GetContainer(
87 root, internal::kShellWindowId_DefaultContainer);
88 for (Window::Windows::const_reverse_iterator i =
89 container->children().rbegin();
90 i != container->children().rend(); ++i) {
91 Window* workspace_window = *i;
92 if (workspace_window->id() == internal::kShellWindowId_WorkspaceContainer) {
93 windows.insert(windows.end(), workspace_window->children().begin(),
94 workspace_window->children().end());
97 return windows;
100 // Reparents |window| to |new_parent|.
101 void ReparentWindow(aura::Window* window, aura::Window* new_parent) {
102 // Update the restore bounds to make it relative to the display.
103 gfx::Rect restore_bounds(GetRestoreBoundsInParent(window));
104 new_parent->AddChild(window);
105 if (!restore_bounds.IsEmpty())
106 SetRestoreBoundsInParent(window, restore_bounds);
109 // Reparents the appropriate set of windows from |src| to |dst|.
110 void ReparentAllWindows(aura::RootWindow* src, aura::RootWindow* dst) {
111 // Set of windows to move.
112 const int kContainerIdsToMove[] = {
113 internal::kShellWindowId_DefaultContainer,
114 internal::kShellWindowId_PanelContainer,
115 internal::kShellWindowId_AlwaysOnTopContainer,
116 internal::kShellWindowId_SystemModalContainer,
117 internal::kShellWindowId_LockSystemModalContainer,
118 internal::kShellWindowId_InputMethodContainer,
119 internal::kShellWindowId_UnparentedControlContainer,
121 // For workspace windows we need to manually reparent the windows. This way
122 // workspace can move the windows to the appropriate workspace.
123 std::vector<aura::Window*> windows(GetWorkspaceWindows(src));
124 internal::WorkspaceController* workspace_controller =
125 GetRootWindowController(dst)->workspace_controller();
126 for (size_t i = 0; i < windows.size(); ++i) {
127 aura::Window* new_parent =
128 workspace_controller->GetParentForNewWindow(windows[i]);
129 ReparentWindow(windows[i], new_parent);
131 for (size_t i = 0; i < arraysize(kContainerIdsToMove); i++) {
132 int id = kContainerIdsToMove[i];
133 if (id == internal::kShellWindowId_DefaultContainer)
134 continue;
136 aura::Window* src_container = Shell::GetContainer(src, id);
137 aura::Window* dst_container = Shell::GetContainer(dst, id);
138 while (!src_container->children().empty()) {
139 // Restart iteration from the source container windows each time as they
140 // may change as a result of moving other windows.
141 aura::Window::Windows::const_iterator iter =
142 src_container->children().begin();
143 while (iter != src_container->children().end() &&
144 internal::SystemModalContainerLayoutManager::IsModalBackground(
145 *iter)) {
146 ++iter;
148 // If the entire window list is modal background windows then stop.
149 if (iter == src_container->children().end())
150 break;
151 ReparentWindow(*iter, dst_container);
156 // Mark the container window so that a widget added to this container will
157 // use the virtual screeen coordinates instead of parent.
158 void SetUsesScreenCoordinates(aura::Window* container) {
159 container->SetProperty(internal::kUsesScreenCoordinatesKey, true);
162 } // namespace
164 namespace internal {
166 RootWindowController::RootWindowController(aura::RootWindow* root_window)
167 : root_window_(root_window),
168 root_window_layout_(NULL),
169 shelf_(NULL),
170 panel_layout_manager_(NULL) {
171 SetRootWindowController(root_window, this);
172 screen_dimmer_.reset(new ScreenDimmer(root_window));
174 stacking_controller_.reset(new ash::StackingController);
175 aura::client::SetStackingClient(root_window, stacking_controller_.get());
178 RootWindowController::~RootWindowController() {
179 Shutdown();
180 root_window_.reset();
183 // static
184 RootWindowController* RootWindowController::ForLauncher(aura::Window* window) {
185 if (Shell::IsLauncherPerDisplayEnabled())
186 return GetRootWindowController(window->GetRootWindow());
187 else
188 return Shell::GetPrimaryRootWindowController();
191 // static
192 RootWindowController* RootWindowController::ForWindow(
193 const aura::Window* window) {
194 return GetRootWindowController(window->GetRootWindow());
197 // static
198 RootWindowController* RootWindowController::ForActiveRootWindow() {
199 return GetRootWindowController(Shell::GetActiveRootWindow());
202 void RootWindowController::Shutdown() {
203 // Remove touch observer HUD.
204 SetTouchObserverHUD(NULL);
206 CloseChildWindows();
207 if (Shell::GetActiveRootWindow() == root_window_.get()) {
208 Shell::GetInstance()->set_active_root_window(
209 Shell::GetPrimaryRootWindow() == root_window_.get() ?
210 NULL : Shell::GetPrimaryRootWindow());
212 SetRootWindowController(root_window_.get(), NULL);
213 screen_dimmer_.reset();
214 workspace_controller_.reset();
215 // Forget with the display ID so that display lookup
216 // ends up with invalid display.
217 root_window_->ClearProperty(kDisplayIdKey);
218 // And this root window should no longer process events.
219 root_window_->PrepareForShutdown();
221 system_background_.reset();
224 SystemModalContainerLayoutManager*
225 RootWindowController::GetSystemModalLayoutManager(aura::Window* window) {
226 aura::Window* container = NULL;
227 if (window) {
228 if (window->parent() &&
229 window->parent()->id() >= kShellWindowId_LockScreenContainer) {
230 container = GetContainer(kShellWindowId_LockSystemModalContainer);
231 } else {
232 container = GetContainer(kShellWindowId_SystemModalContainer);
234 } else {
235 user::LoginStatus login = Shell::GetInstance()->system_tray_delegate() ?
236 Shell::GetInstance()->system_tray_delegate()->GetUserLoginStatus() :
237 user::LOGGED_IN_NONE;
238 int modal_window_id = (login == user::LOGGED_IN_LOCKED ||
239 login == user::LOGGED_IN_NONE) ?
240 kShellWindowId_LockSystemModalContainer :
241 kShellWindowId_SystemModalContainer;
242 container = GetContainer(modal_window_id);
244 return static_cast<SystemModalContainerLayoutManager*>(
245 container->layout_manager());
248 aura::Window* RootWindowController::GetContainer(int container_id) {
249 return root_window_->GetChildById(container_id);
252 void RootWindowController::InitLayoutManagers() {
253 root_window_layout_ =
254 new RootWindowLayoutManager(root_window_.get());
255 root_window_->SetLayoutManager(root_window_layout_);
257 aura::Window* default_container =
258 GetContainer(kShellWindowId_DefaultContainer);
259 // Workspace manager has its own layout managers.
260 workspace_controller_.reset(
261 new WorkspaceController(default_container));
263 aura::Window* always_on_top_container =
264 GetContainer(kShellWindowId_AlwaysOnTopContainer);
265 always_on_top_container->SetLayoutManager(
266 new BaseLayoutManager(
267 always_on_top_container->GetRootWindow()));
270 void RootWindowController::InitForPrimaryDisplay() {
271 DCHECK(!shelf_.get());
272 aura::Window* shelf_container =
273 GetContainer(ash::internal::kShellWindowId_ShelfContainer);
274 // TODO(harrym): Remove when status area is view.
275 aura::Window* status_container =
276 GetContainer(ash::internal::kShellWindowId_StatusContainer);
277 shelf_.reset(new ash::ShelfWidget(
278 shelf_container, status_container, workspace_controller()));
280 if (Shell::IsLauncherPerDisplayEnabled() ||
281 root_window_ == Shell::GetPrimaryRootWindow()) {
282 // Create Panel layout manager
283 aura::Window* panel_container = GetContainer(
284 internal::kShellWindowId_PanelContainer);
285 panel_layout_manager_ =
286 new internal::PanelLayoutManager(panel_container);
287 panel_container_handler_.reset(
288 new ToplevelWindowEventHandler(panel_container));
289 panel_container->SetLayoutManager(panel_layout_manager_);
291 if (Shell::GetInstance()->delegate()->IsUserLoggedIn())
292 shelf_->CreateLauncher();
295 void RootWindowController::CreateContainers() {
296 CreateContainersInRootWindow(root_window_.get());
298 // Create touch observer HUD if needed. HUD should be created after the
299 // containers have been created, so that its widget can be added to them.
300 CommandLine* command_line = CommandLine::ForCurrentProcess();
301 if (command_line->HasSwitch(switches::kAshTouchHud)) {
302 int64 id = root_window_->GetProperty(kDisplayIdKey);
303 const gfx::Display& display = Shell::GetInstance()->display_manager()->
304 GetDisplayForId(id);
305 SetTouchObserverHUD(new TouchObserverHUD(display));
309 void RootWindowController::CreateSystemBackground(
310 bool is_first_run_after_boot) {
311 SkColor color = SK_ColorBLACK;
312 #if defined(OS_CHROMEOS)
313 if (is_first_run_after_boot)
314 color = kChromeOsBootColor;
315 #endif
316 system_background_.reset(
317 new SystemBackgroundController(root_window_.get(), color));
319 #if defined(OS_CHROMEOS)
320 // Make a copy of the system's boot splash screen so we can composite it
321 // onscreen until the desktop background is ready.
322 if (is_first_run_after_boot &&
323 (CommandLine::ForCurrentProcess()->HasSwitch(
324 switches::kAshCopyHostBackgroundAtBoot) ||
325 CommandLine::ForCurrentProcess()->HasSwitch(
326 switches::kAshAnimateFromBootSplashScreen)))
327 boot_splash_screen_.reset(new BootSplashScreen(root_window_.get()));
328 #endif
331 void RootWindowController::OnLauncherCreated() {
332 if (panel_layout_manager_)
333 panel_layout_manager_->SetLauncher(shelf_->launcher());
336 void RootWindowController::ShowLauncher() {
337 if (!shelf_.get() || !shelf_->launcher())
338 return;
339 shelf_->launcher()->SetVisible(true);
340 shelf_->status_area_widget()->Show();
343 void RootWindowController::OnLoginStateChanged(user::LoginStatus status) {
344 // TODO(oshima): remove if when launcher per display is enabled by
345 // default.
346 if (shelf_.get())
347 shelf_->shelf_layout_manager()->UpdateVisibilityState();
350 void RootWindowController::UpdateAfterLoginStatusChange(
351 user::LoginStatus status) {
352 if (shelf_.get() && shelf_->status_area_widget())
353 shelf_->status_area_widget()->UpdateAfterLoginStatusChange(status);
356 void RootWindowController::HandleInitialDesktopBackgroundAnimationStarted() {
357 if (CommandLine::ForCurrentProcess()->HasSwitch(
358 switches::kAshAnimateFromBootSplashScreen) &&
359 boot_splash_screen_.get()) {
360 // Make the splash screen fade out so it doesn't obscure the desktop
361 // wallpaper's brightness/grayscale animation.
362 boot_splash_screen_->StartHideAnimation(
363 base::TimeDelta::FromMilliseconds(kBootSplashScreenHideDurationMs));
367 void RootWindowController::HandleDesktopBackgroundVisible() {
368 system_background_->SetColor(SK_ColorBLACK);
369 boot_splash_screen_.reset();
372 void RootWindowController::CloseChildWindows() {
373 // panel_layout_manager_ needs to be shut down before windows are destroyed.
374 if (panel_layout_manager_) {
375 panel_layout_manager_->Shutdown();
376 panel_layout_manager_ = NULL;
379 // TODO(harrym): Remove when Status Area Widget is a child view.
380 if (shelf_.get())
381 shelf_->ShutdownStatusAreaWidget();
383 if (shelf_.get() && shelf_->shelf_layout_manager())
384 shelf_->shelf_layout_manager()->set_workspace_controller(NULL);
386 // Close background widget first as it depends on tooltip.
387 root_window_->SetProperty(kDesktopController,
388 static_cast<DesktopBackgroundWidgetController*>(NULL));
389 root_window_->SetProperty(kAnimatingDesktopController,
390 static_cast<AnimatingDesktopController*>(NULL));
392 workspace_controller_.reset();
393 aura::client::SetTooltipClient(root_window_.get(), NULL);
395 while (!root_window_->children().empty()) {
396 aura::Window* child = root_window_->children()[0];
397 delete child;
400 shelf_.reset(NULL);
403 void RootWindowController::MoveWindowsTo(aura::RootWindow* dst) {
404 aura::Window* focused = aura::client::GetFocusClient(dst)->GetFocusedWindow();
405 aura::WindowTracker tracker;
406 if (focused)
407 tracker.Add(focused);
408 aura::client::ActivationClient* activation_client =
409 aura::client::GetActivationClient(dst);
410 aura::Window* active = activation_client->GetActiveWindow();
411 if (active && focused != active)
412 tracker.Add(active);
413 // Deactivate the window to close menu / bubble windows.
414 activation_client->DeactivateWindow(active);
415 // Release capture if any.
416 aura::client::GetCaptureClient(root_window_.get())->
417 SetCapture(NULL);
418 // Clear the focused window if any. This is necessary because a
419 // window may be deleted when losing focus (fullscreen flash for
420 // example). If the focused window is still alive after move, it'll
421 // be re-focused below.
422 aura::client::GetFocusClient(dst)->FocusWindow(NULL);
424 // Forget the shelf early so that shelf don't update itself using wrong
425 // display info.
426 workspace_controller_->SetShelf(NULL);
428 ReparentAllWindows(root_window_.get(), dst);
430 // Restore focused or active window if it's still alive.
431 if (focused && tracker.Contains(focused) && dst->Contains(focused)) {
432 aura::client::GetFocusClient(dst)->FocusWindow(focused);
433 } else if (active && tracker.Contains(active) && dst->Contains(active)) {
434 activation_client->ActivateWindow(active);
438 void RootWindowController::SetTouchObserverHUD(TouchObserverHUD* hud) {
439 if (touch_observer_hud_.get())
440 root_window_->RemovePreTargetHandler(touch_observer_hud_.get());
441 if (hud)
442 root_window_->AddPreTargetHandler(hud);
443 touch_observer_hud_.reset(hud);
446 ShelfLayoutManager* RootWindowController::GetShelfLayoutManager() {
447 return shelf_.get() ? shelf_->shelf_layout_manager() : NULL;
450 SystemTray* RootWindowController::GetSystemTray() {
451 // We assume in throughout the code that this will not return NULL. If code
452 // triggers this for valid reasons, it should test status_area_widget first.
453 CHECK(shelf_.get() && shelf_->status_area_widget());
454 return shelf_->status_area_widget()->system_tray();
457 void RootWindowController::ShowContextMenu(
458 const gfx::Point& location_in_screen) {
459 aura::RootWindow* target = Shell::IsLauncherPerDisplayEnabled() ?
460 root_window() : Shell::GetPrimaryRootWindow();
461 DCHECK(Shell::GetInstance()->delegate());
462 scoped_ptr<ui::MenuModel> menu_model(
463 Shell::GetInstance()->delegate()->CreateContextMenu(target));
464 if (!menu_model.get())
465 return;
467 views::MenuRunner menu_runner(menu_model.get());
468 views::Widget* widget =
469 root_window_->GetProperty(kDesktopController)->widget();
471 if (menu_runner.RunMenuAt(
472 widget, NULL, gfx::Rect(location_in_screen, gfx::Size()),
473 views::MenuItemView::TOPLEFT, views::MenuRunner::CONTEXT_MENU) ==
474 views::MenuRunner::MENU_DELETED)
475 return;
477 Shell::GetInstance()->UpdateShelfVisibility();
480 void RootWindowController::UpdateShelfVisibility() {
481 shelf_->shelf_layout_manager()->UpdateVisibilityState();
484 bool RootWindowController::IsImmersiveMode() const {
485 aura::Window* container = workspace_controller_->GetActiveWorkspaceWindow();
486 for (size_t i = 0; i < container->children().size(); ++i) {
487 aura::Window* child = container->children()[i];
488 if (child->IsVisible() && child->GetProperty(kImmersiveModeKey))
489 return true;
491 return false;
494 ////////////////////////////////////////////////////////////////////////////////
495 // RootWindowController, private:
497 void RootWindowController::CreateContainersInRootWindow(
498 aura::RootWindow* root_window) {
499 // These containers are just used by PowerButtonController to animate groups
500 // of containers simultaneously without messing up the current transformations
501 // on those containers. These are direct children of the root window; all of
502 // the other containers are their children.
504 // The desktop background container is not part of the lock animation, so it
505 // is not included in those animate groups.
506 // When screen is locked desktop background is moved to lock screen background
507 // container (moved back on unlock). We want to make sure that there's an
508 // opaque layer occluding the non-lock-screen layers.
509 aura::Window* desktop_background_container = CreateContainer(
510 kShellWindowId_DesktopBackgroundContainer,
511 "DesktopBackgroundContainer",
512 root_window);
513 views::corewm::SetChildWindowVisibilityChangesAnimated(
514 desktop_background_container);
516 aura::Window* non_lock_screen_containers = CreateContainer(
517 kShellWindowId_NonLockScreenContainersContainer,
518 "NonLockScreenContainersContainer",
519 root_window);
521 aura::Window* lock_background_containers = CreateContainer(
522 kShellWindowId_LockScreenBackgroundContainer,
523 "LockScreenBackgroundContainer",
524 root_window);
525 views::corewm::SetChildWindowVisibilityChangesAnimated(
526 lock_background_containers);
528 aura::Window* lock_screen_containers = CreateContainer(
529 kShellWindowId_LockScreenContainersContainer,
530 "LockScreenContainersContainer",
531 root_window);
532 aura::Window* lock_screen_related_containers = CreateContainer(
533 kShellWindowId_LockScreenRelatedContainersContainer,
534 "LockScreenRelatedContainersContainer",
535 root_window);
537 CreateContainer(kShellWindowId_UnparentedControlContainer,
538 "UnparentedControlContainer",
539 non_lock_screen_containers);
541 aura::Window* default_container = CreateContainer(
542 kShellWindowId_DefaultContainer,
543 "DefaultContainer",
544 non_lock_screen_containers);
545 views::corewm::SetChildWindowVisibilityChangesAnimated(default_container);
546 SetUsesScreenCoordinates(default_container);
548 aura::Window* always_on_top_container = CreateContainer(
549 kShellWindowId_AlwaysOnTopContainer,
550 "AlwaysOnTopContainer",
551 non_lock_screen_containers);
552 always_on_top_container_handler_.reset(
553 new ToplevelWindowEventHandler(always_on_top_container));
554 views::corewm::SetChildWindowVisibilityChangesAnimated(
555 always_on_top_container);
556 SetUsesScreenCoordinates(always_on_top_container);
558 aura::Window* panel_container = CreateContainer(
559 kShellWindowId_PanelContainer,
560 "PanelContainer",
561 non_lock_screen_containers);
562 SetUsesScreenCoordinates(panel_container);
564 aura::Window* launcher_container =
565 CreateContainer(kShellWindowId_ShelfContainer,
566 "LauncherContainer",
567 non_lock_screen_containers);
568 SetUsesScreenCoordinates(launcher_container);
570 aura::Window* app_list_container =
571 CreateContainer(kShellWindowId_AppListContainer,
572 "AppListContainer",
573 non_lock_screen_containers);
574 SetUsesScreenCoordinates(app_list_container);
576 aura::Window* modal_container = CreateContainer(
577 kShellWindowId_SystemModalContainer,
578 "SystemModalContainer",
579 non_lock_screen_containers);
580 modal_container_handler_.reset(
581 new ToplevelWindowEventHandler(modal_container));
582 modal_container->SetLayoutManager(
583 new SystemModalContainerLayoutManager(modal_container));
584 views::corewm::SetChildWindowVisibilityChangesAnimated(modal_container);
585 SetUsesScreenCoordinates(modal_container);
587 aura::Window* input_method_container = CreateContainer(
588 kShellWindowId_InputMethodContainer,
589 "InputMethodContainer",
590 non_lock_screen_containers);
591 SetUsesScreenCoordinates(input_method_container);
593 // TODO(beng): Figure out if we can make this use
594 // SystemModalContainerEventFilter instead of stops_event_propagation.
595 aura::Window* lock_container = CreateContainer(
596 kShellWindowId_LockScreenContainer,
597 "LockScreenContainer",
598 lock_screen_containers);
599 lock_container->SetLayoutManager(
600 new BaseLayoutManager(root_window));
601 SetUsesScreenCoordinates(lock_container);
602 // TODO(beng): stopsevents
604 aura::Window* lock_modal_container = CreateContainer(
605 kShellWindowId_LockSystemModalContainer,
606 "LockSystemModalContainer",
607 lock_screen_containers);
608 lock_modal_container_handler_.reset(
609 new ToplevelWindowEventHandler(lock_modal_container));
610 lock_modal_container->SetLayoutManager(
611 new SystemModalContainerLayoutManager(lock_modal_container));
612 views::corewm::SetChildWindowVisibilityChangesAnimated(lock_modal_container);
613 SetUsesScreenCoordinates(lock_modal_container);
615 aura::Window* status_container =
616 CreateContainer(kShellWindowId_StatusContainer,
617 "StatusContainer",
618 lock_screen_related_containers);
619 SetUsesScreenCoordinates(status_container);
621 aura::Window* settings_bubble_container = CreateContainer(
622 kShellWindowId_SettingBubbleContainer,
623 "SettingBubbleContainer",
624 lock_screen_related_containers);
625 views::corewm::SetChildWindowVisibilityChangesAnimated(
626 settings_bubble_container);
627 SetUsesScreenCoordinates(settings_bubble_container);
629 aura::Window* menu_container = CreateContainer(
630 kShellWindowId_MenuContainer,
631 "MenuContainer",
632 lock_screen_related_containers);
633 views::corewm::SetChildWindowVisibilityChangesAnimated(menu_container);
634 SetUsesScreenCoordinates(menu_container);
636 aura::Window* drag_drop_container = CreateContainer(
637 kShellWindowId_DragImageAndTooltipContainer,
638 "DragImageAndTooltipContainer",
639 lock_screen_related_containers);
640 views::corewm::SetChildWindowVisibilityChangesAnimated(drag_drop_container);
641 SetUsesScreenCoordinates(drag_drop_container);
643 aura::Window* overlay_container = CreateContainer(
644 kShellWindowId_OverlayContainer,
645 "OverlayContainer",
646 lock_screen_related_containers);
647 SetUsesScreenCoordinates(overlay_container);
649 CreateContainer(kShellWindowId_PowerButtonAnimationContainer,
650 "PowerButtonAnimationContainer", root_window) ;
653 } // namespace internal
654 } // namespace ash