| 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/event.h" | 6 #include "aura/event.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" |
| 11 #include "base/i18n/icu_util.h" | 11 #include "base/i18n/icu_util.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/message_loop.h" |
| 13 #include "third_party/skia/include/core/SkXfermode.h" | 14 #include "third_party/skia/include/core/SkXfermode.h" |
| 14 #include "ui/base/resource/resource_bundle.h" | 15 #include "ui/base/resource/resource_bundle.h" |
| 15 #include "ui/base/ui_base_paths.h" | 16 #include "ui/base/ui_base_paths.h" |
| 16 #include "ui/gfx/canvas_skia.h" | 17 #include "ui/gfx/canvas_skia.h" |
| 17 #include "ui/gfx/rect.h" | 18 #include "ui/gfx/rect.h" |
| 18 | 19 |
| 19 #if defined(USE_X11) | 20 #if defined(USE_X11) |
| 20 #include "aura/hit_test.h" | 21 #include "aura/hit_test.h" |
| 21 #include "base/message_pump_x.h" | 22 #include "base/message_pump_x.h" |
| 22 #endif | 23 #endif |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 base::AtExitManager exit_manager; | 66 base::AtExitManager exit_manager; |
| 66 | 67 |
| 67 ui::RegisterPathProvider(); | 68 ui::RegisterPathProvider(); |
| 68 icu_util::Initialize(); | 69 icu_util::Initialize(); |
| 69 ResourceBundle::InitSharedInstance("en-US"); | 70 ResourceBundle::InitSharedInstance("en-US"); |
| 70 | 71 |
| 71 #if defined(USE_X11) | 72 #if defined(USE_X11) |
| 72 base::MessagePumpX::DisableGtkMessagePump(); | 73 base::MessagePumpX::DisableGtkMessagePump(); |
| 73 #endif | 74 #endif |
| 74 | 75 |
| 76 // Create the message-loop here before creating the desktop. |
| 77 MessageLoop message_loop(MessageLoop::TYPE_UI); |
| 78 |
| 75 aura::Desktop::GetInstance(); | 79 aura::Desktop::GetInstance(); |
| 76 | 80 |
| 77 // Create a hierarchy of test windows. | 81 // Create a hierarchy of test windows. |
| 78 DemoWindowDelegate window_delegate1(SK_ColorBLUE); | 82 DemoWindowDelegate window_delegate1(SK_ColorBLUE); |
| 79 aura::Window window1(&window_delegate1); | 83 aura::Window window1(&window_delegate1); |
| 80 window1.set_id(1); | 84 window1.set_id(1); |
| 81 window1.Init(); | 85 window1.Init(); |
| 82 window1.SetBounds(gfx::Rect(100, 100, 400, 400), 0); | 86 window1.SetBounds(gfx::Rect(100, 100, 400, 400), 0); |
| 83 window1.SetVisibility(aura::Window::VISIBILITY_SHOWN); | 87 window1.SetVisibility(aura::Window::VISIBILITY_SHOWN); |
| 84 window1.SetParent(NULL); | 88 window1.SetParent(NULL); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 96 window3.set_id(3); | 100 window3.set_id(3); |
| 97 window3.Init(); | 101 window3.Init(); |
| 98 window3.SetBounds(gfx::Rect(10, 10, 50, 50), 0); | 102 window3.SetBounds(gfx::Rect(10, 10, 50, 50), 0); |
| 99 window3.SetVisibility(aura::Window::VISIBILITY_SHOWN); | 103 window3.SetVisibility(aura::Window::VISIBILITY_SHOWN); |
| 100 window3.SetParent(&window2); | 104 window3.SetParent(&window2); |
| 101 | 105 |
| 102 aura::Desktop::GetInstance()->Run(); | 106 aura::Desktop::GetInstance()->Run(); |
| 103 return 0; | 107 return 0; |
| 104 } | 108 } |
| 105 | 109 |
| OLD | NEW |