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 "base/at_exit.h" | 5 #include "base/at_exit.h" |
6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
7 #include "base/i18n/icu_util.h" | 7 #include "base/i18n/icu_util.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "third_party/skia/include/core/SkXfermode.h" | |
11 #include "ui/aura/desktop.h" | 10 #include "ui/aura/desktop.h" |
12 #include "ui/aura/desktop_host.h" | 11 #include "ui/aura_shell/desktop_layout_manager.h" |
13 #include "ui/aura/window.h" | 12 #include "ui/aura_shell/shell_factory.h" |
14 #include "ui/aura/window_delegate.h" | |
15 #include "ui/base/resource/resource_bundle.h" | 13 #include "ui/base/resource/resource_bundle.h" |
16 #include "ui/base/ui_base_paths.h" | 14 #include "ui/base/ui_base_paths.h" |
17 #include "ui/gfx/canvas.h" | |
18 #include "ui/gfx/canvas_skia.h" | |
19 #include "ui/gfx/rect.h" | |
20 #include "views/widget/widget.h" | |
21 #include "views/widget/widget_delegate.h" | |
22 | 15 |
23 #if !defined(OS_WIN) | 16 namespace aura_shell { |
24 #include "ui/aura/hit_test.h" | 17 namespace internal { |
25 #endif | 18 |
| 19 void InitDesktopWindow() { |
| 20 aura::Window* desktop_window = aura::Desktop::GetInstance()->window(); |
| 21 DesktopLayoutManager* desktop_layout = |
| 22 new DesktopLayoutManager(desktop_window); |
| 23 desktop_window->SetLayoutManager(desktop_layout); |
| 24 |
| 25 desktop_layout->set_background_widget(CreateDesktopBackground()); |
| 26 desktop_layout->set_launcher_widget(CreateLauncher()); |
| 27 } |
| 28 |
| 29 } // namespace internal |
| 30 } // namespace aura_shell |
26 | 31 |
27 int main(int argc, char** argv) { | 32 int main(int argc, char** argv) { |
28 CommandLine::Init(argc, argv); | 33 CommandLine::Init(argc, argv); |
29 | 34 |
30 // The exit manager is in charge of calling the dtors of singleton objects. | 35 // The exit manager is in charge of calling the dtors of singleton objects. |
31 base::AtExitManager exit_manager; | 36 base::AtExitManager exit_manager; |
32 | 37 |
33 ui::RegisterPathProvider(); | 38 ui::RegisterPathProvider(); |
34 icu_util::Initialize(); | 39 icu_util::Initialize(); |
35 ResourceBundle::InitSharedInstance("en-US"); | 40 ResourceBundle::InitSharedInstance("en-US"); |
36 | 41 |
37 #if defined(USE_X11) | 42 #if defined(USE_X11) |
38 base::MessagePumpX::DisableGtkMessagePump(); | 43 base::MessagePumpX::DisableGtkMessagePump(); |
39 #endif | 44 #endif |
40 | 45 |
41 // Create the message-loop here before creating the desktop. | 46 // Create the message-loop here before creating the desktop. |
42 MessageLoop message_loop(MessageLoop::TYPE_UI); | 47 MessageLoop message_loop(MessageLoop::TYPE_UI); |
43 | 48 |
| 49 aura_shell::internal::InitDesktopWindow(); |
| 50 |
44 aura::Desktop::GetInstance()->Run(); | 51 aura::Desktop::GetInstance()->Run(); |
45 | 52 |
46 delete aura::Desktop::GetInstance(); | 53 delete aura::Desktop::GetInstance(); |
47 | 54 |
48 return 0; | 55 return 0; |
49 } | 56 } |
50 | 57 |
OLD | NEW |