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 "aura/desktop.h" | 5 #include "aura/desktop.h" |
6 #include "aura/desktop_host.h" | 6 #include "aura/desktop_host.h" |
7 #include "aura/window.h" | 7 #include "aura/window.h" |
8 #include "aura/window_delegate.h" | 8 #include "aura/window_delegate.h" |
9 #include "base/at_exit.h" | 9 #include "base/at_exit.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 base::AtExitManager exit_manager; | 114 base::AtExitManager exit_manager; |
115 | 115 |
116 ui::RegisterPathProvider(); | 116 ui::RegisterPathProvider(); |
117 icu_util::Initialize(); | 117 icu_util::Initialize(); |
118 ResourceBundle::InitSharedInstance("en-US"); | 118 ResourceBundle::InitSharedInstance("en-US"); |
119 | 119 |
120 #if defined(USE_X11) | 120 #if defined(USE_X11) |
121 base::MessagePumpX::DisableGtkMessagePump(); | 121 base::MessagePumpX::DisableGtkMessagePump(); |
122 #endif | 122 #endif |
123 | 123 |
| 124 // Create the message-loop here before creating the desktop. |
| 125 MessageLoop message_loop(MessageLoop::TYPE_UI); |
| 126 |
124 aura::Desktop::GetInstance(); | 127 aura::Desktop::GetInstance(); |
125 | 128 |
126 // Create a hierarchy of test windows. | 129 // Create a hierarchy of test windows. |
127 DemoWindowDelegate window_delegate1(SK_ColorBLUE); | 130 DemoWindowDelegate window_delegate1(SK_ColorBLUE); |
128 aura::Window window1(&window_delegate1); | 131 aura::Window window1(&window_delegate1); |
129 window1.set_id(1); | 132 window1.set_id(1); |
130 window1.Init(); | 133 window1.Init(); |
131 window1.SetBounds(gfx::Rect(100, 100, 400, 400), 0); | 134 window1.SetBounds(gfx::Rect(100, 100, 400, 400), 0); |
132 window1.SetVisibility(aura::Window::VISIBILITY_SHOWN); | 135 window1.SetVisibility(aura::Window::VISIBILITY_SHOWN); |
133 window1.SetParent(NULL); | 136 window1.SetParent(NULL); |
(...skipping 23 matching lines...) Expand all Loading... |
157 | 160 |
158 TestWindowContents* contents = new TestWindowContents; | 161 TestWindowContents* contents = new TestWindowContents; |
159 views::Widget* views_window = views::Widget::CreateWindowWithParentAndBounds( | 162 views::Widget* views_window = views::Widget::CreateWindowWithParentAndBounds( |
160 contents, &window2, gfx::Rect(120, 150, 200, 200)); | 163 contents, &window2, gfx::Rect(120, 150, 200, 200)); |
161 views_window->Show(); | 164 views_window->Show(); |
162 | 165 |
163 aura::Desktop::GetInstance()->Run(); | 166 aura::Desktop::GetInstance()->Run(); |
164 return 0; | 167 return 0; |
165 } | 168 } |
166 | 169 |
OLD | NEW |