OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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" | 10 #include "third_party/skia/include/core/SkXfermode.h" |
11 #include "ui/aura/client/stacking_client.h" | 11 #include "ui/aura/client/stacking_client.h" |
| 12 #include "ui/aura/env.h" |
12 #include "ui/aura/event.h" | 13 #include "ui/aura/event.h" |
| 14 #include "ui/aura/monitor_manager.h" |
13 #include "ui/aura/root_window.h" | 15 #include "ui/aura/root_window.h" |
14 #include "ui/aura/window.h" | 16 #include "ui/aura/window.h" |
15 #include "ui/aura/window_delegate.h" | 17 #include "ui/aura/window_delegate.h" |
16 #include "ui/base/hit_test.h" | 18 #include "ui/base/hit_test.h" |
17 #include "ui/base/resource/resource_bundle.h" | 19 #include "ui/base/resource/resource_bundle.h" |
18 #include "ui/base/ui_base_paths.h" | 20 #include "ui/base/ui_base_paths.h" |
19 #include "ui/gfx/canvas.h" | 21 #include "ui/gfx/canvas.h" |
20 #include "ui/gfx/compositor/test/compositor_test_support.h" | 22 #include "ui/gfx/compositor/test/compositor_test_support.h" |
21 #include "ui/gfx/rect.h" | 23 #include "ui/gfx/rect.h" |
22 | 24 |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 base::AtExitManager exit_manager; | 105 base::AtExitManager exit_manager; |
104 | 106 |
105 ui::RegisterPathProvider(); | 107 ui::RegisterPathProvider(); |
106 icu_util::Initialize(); | 108 icu_util::Initialize(); |
107 ResourceBundle::InitSharedInstanceWithLocale("en-US"); | 109 ResourceBundle::InitSharedInstanceWithLocale("en-US"); |
108 | 110 |
109 // Create the message-loop here before creating the root window. | 111 // Create the message-loop here before creating the root window. |
110 MessageLoop message_loop(MessageLoop::TYPE_UI); | 112 MessageLoop message_loop(MessageLoop::TYPE_UI); |
111 ui::CompositorTestSupport::Initialize(); | 113 ui::CompositorTestSupport::Initialize(); |
112 | 114 |
113 scoped_ptr<aura::RootWindow> root_window(new aura::RootWindow); | 115 scoped_ptr<aura::RootWindow> root_window( |
| 116 Env::GetInstance()->monitor_manager()-> |
| 117 CreateRootWindowForPrimaryMonitor()); |
114 scoped_ptr<DemoStackingClient> stacking_client(new DemoStackingClient( | 118 scoped_ptr<DemoStackingClient> stacking_client(new DemoStackingClient( |
115 root_window.get())); | 119 root_window.get())); |
116 | 120 |
117 // Create a hierarchy of test windows. | 121 // Create a hierarchy of test windows. |
118 DemoWindowDelegate window_delegate1(SK_ColorBLUE); | 122 DemoWindowDelegate window_delegate1(SK_ColorBLUE); |
119 aura::Window window1(&window_delegate1); | 123 aura::Window window1(&window_delegate1); |
120 window1.set_id(1); | 124 window1.set_id(1); |
121 window1.Init(ui::Layer::LAYER_TEXTURED); | 125 window1.Init(ui::Layer::LAYER_TEXTURED); |
122 window1.SetBounds(gfx::Rect(100, 100, 400, 400)); | 126 window1.SetBounds(gfx::Rect(100, 100, 400, 400)); |
123 window1.Show(); | 127 window1.Show(); |
(...skipping 15 matching lines...) Expand all Loading... |
139 window3.Show(); | 143 window3.Show(); |
140 window3.SetParent(&window2); | 144 window3.SetParent(&window2); |
141 | 145 |
142 root_window->ShowRootWindow(); | 146 root_window->ShowRootWindow(); |
143 MessageLoopForUI::current()->Run(); | 147 MessageLoopForUI::current()->Run(); |
144 | 148 |
145 ui::CompositorTestSupport::Terminate(); | 149 ui::CompositorTestSupport::Terminate(); |
146 | 150 |
147 return 0; | 151 return 0; |
148 } | 152 } |
OLD | NEW |