OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "ui/aura/desktop.h" |
| 6 #include "ui/aura/toplevel_window_container.h" |
| 7 #include "ui/aura/window.h" |
| 8 #include "ui/aura_shell/desktop_layout_manager.h" |
| 9 #include "ui/aura_shell/shell_factory.h" |
| 10 |
| 11 namespace aura_shell { |
| 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() { |
| 28 aura::Window* desktop_window = aura::Desktop::GetInstance()->window(); |
| 29 internal::DesktopLayoutManager* desktop_layout = |
| 30 new internal::DesktopLayoutManager(desktop_window); |
| 31 desktop_window->SetLayoutManager(desktop_layout); |
| 32 |
| 33 // The order of creation here is important to establish the z-index: |
| 34 desktop_layout->set_background_widget(internal::CreateDesktopBackground()); |
| 35 desktop_layout->set_toplevel_window_container( |
| 36 internal::CreateToplevelWindowContainer()); |
| 37 desktop_layout->set_launcher_widget(internal::CreateLauncher()); |
| 38 desktop_layout->set_status_area_widget(internal::CreateStatusArea()); |
| 39 } |
| 40 |
| 41 } // namespace aura_shell |
| 42 |
OLD | NEW |