OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "ui/aura/desktop.h" | 5 #include "ui/aura/desktop.h" |
6 #include "ui/aura/toplevel_window_container.h" | 6 #include "ui/aura/toplevel_window_container.h" |
7 #include "ui/aura/window.h" | 7 #include "ui/aura/window.h" |
8 #include "ui/aura_shell/desktop_layout_manager.h" | 8 #include "ui/aura_shell/desktop_layout_manager.h" |
9 #include "ui/aura_shell/shell_factory.h" | 9 #include "ui/aura_shell/shell_factory.h" |
10 | 10 |
11 namespace aura_shell { | 11 namespace aura_shell { |
12 | 12 |
13 namespace internal { | |
14 | |
15 aura::Window* CreateToplevelWindowContainer() { | |
16 aura::Window* container = new aura::internal::ToplevelWindowContainer; | |
17 container->Init(); | |
18 container->SetBounds(gfx::Rect(0, 0, 1024, 768), 0); | |
19 container->SetVisibility(aura::Window::VISIBILITY_SHOWN); | |
20 container->SetParent(aura::Desktop::GetInstance()->window()); | |
21 aura::Desktop::GetInstance()->set_toplevel_window_container(container); | |
22 return container; | |
23 } | |
24 | |
25 } // namespace internal | |
26 | |
27 void InitDesktopWindow() { | 13 void InitDesktopWindow() { |
28 aura::Window* desktop_window = aura::Desktop::GetInstance()->window(); | 14 aura::Window* desktop_window = aura::Desktop::GetInstance()->window(); |
29 internal::DesktopLayoutManager* desktop_layout = | 15 internal::DesktopLayoutManager* desktop_layout = |
30 new internal::DesktopLayoutManager(desktop_window); | 16 new internal::DesktopLayoutManager(desktop_window); |
31 desktop_window->SetLayoutManager(desktop_layout); | 17 desktop_window->SetLayoutManager(desktop_layout); |
32 | 18 |
33 // The order of creation here is important to establish the z-index: | 19 // The order of creation here is important to establish the z-index: |
34 desktop_layout->set_background_widget(internal::CreateDesktopBackground()); | 20 desktop_layout->set_background_widget(internal::CreateDesktopBackground()); |
35 desktop_layout->set_toplevel_window_container( | 21 desktop_layout->set_toplevel_window_container( |
36 internal::CreateToplevelWindowContainer()); | 22 aura::Desktop::GetInstance()->toplevel_window_container()); |
| 23 desktop_window->MoveChildToFront( |
| 24 aura::Desktop::GetInstance()->toplevel_window_container()); |
37 desktop_layout->set_launcher_widget(internal::CreateLauncher()); | 25 desktop_layout->set_launcher_widget(internal::CreateLauncher()); |
38 desktop_layout->set_status_area_widget(internal::CreateStatusArea()); | 26 desktop_layout->set_status_area_widget(internal::CreateStatusArea()); |
39 } | 27 } |
40 | 28 |
41 } // namespace aura_shell | 29 } // namespace aura_shell |
42 | 30 |
OLD | NEW |