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" |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 scoped_ptr<DemoStackingClient> stacking_client(new DemoStackingClient( | 130 scoped_ptr<DemoStackingClient> stacking_client(new DemoStackingClient( |
131 root_window.get())); | 131 root_window.get())); |
132 | 132 |
133 // Create a hierarchy of test windows. | 133 // Create a hierarchy of test windows. |
134 DemoWindowDelegate window_delegate1(SK_ColorBLUE); | 134 DemoWindowDelegate window_delegate1(SK_ColorBLUE); |
135 aura::Window window1(&window_delegate1); | 135 aura::Window window1(&window_delegate1); |
136 window1.set_id(1); | 136 window1.set_id(1); |
137 window1.Init(ui::LAYER_TEXTURED); | 137 window1.Init(ui::LAYER_TEXTURED); |
138 window1.SetBounds(gfx::Rect(100, 100, 400, 400)); | 138 window1.SetBounds(gfx::Rect(100, 100, 400, 400)); |
139 window1.Show(); | 139 window1.Show(); |
140 window1.SetParent(NULL); | 140 window1.SetDefaultParentByTargetRoot(root_window.get(), gfx::Rect()); |
141 | 141 |
142 DemoWindowDelegate window_delegate2(SK_ColorRED); | 142 DemoWindowDelegate window_delegate2(SK_ColorRED); |
143 aura::Window window2(&window_delegate2); | 143 aura::Window window2(&window_delegate2); |
144 window2.set_id(2); | 144 window2.set_id(2); |
145 window2.Init(ui::LAYER_TEXTURED); | 145 window2.Init(ui::LAYER_TEXTURED); |
146 window2.SetBounds(gfx::Rect(200, 200, 350, 350)); | 146 window2.SetBounds(gfx::Rect(200, 200, 350, 350)); |
147 window2.Show(); | 147 window2.Show(); |
148 window2.SetParent(NULL); | 148 window2.SetDefaultParentByTargetRoot(root_window.get(), gfx::Rect()); |
149 | 149 |
150 DemoWindowDelegate window_delegate3(SK_ColorGREEN); | 150 DemoWindowDelegate window_delegate3(SK_ColorGREEN); |
151 aura::Window window3(&window_delegate3); | 151 aura::Window window3(&window_delegate3); |
152 window3.set_id(3); | 152 window3.set_id(3); |
153 window3.Init(ui::LAYER_TEXTURED); | 153 window3.Init(ui::LAYER_TEXTURED); |
154 window3.SetBounds(gfx::Rect(10, 10, 50, 50)); | 154 window3.SetBounds(gfx::Rect(10, 10, 50, 50)); |
155 window3.Show(); | 155 window3.Show(); |
156 window3.SetParent(&window2); | 156 window2.AddChild(&window3); |
157 | 157 |
158 root_window->ShowRootWindow(); | 158 root_window->ShowRootWindow(); |
159 MessageLoopForUI::current()->Run(); | 159 MessageLoopForUI::current()->Run(); |
160 | 160 |
161 ui::CompositorTestSupport::Terminate(); | 161 ui::CompositorTestSupport::Terminate(); |
162 | 162 |
163 return 0; | 163 return 0; |
164 } | 164 } |
165 | 165 |
166 } // namespace | 166 } // namespace |
167 | 167 |
168 int main(int argc, char** argv) { | 168 int main(int argc, char** argv) { |
169 CommandLine::Init(argc, argv); | 169 CommandLine::Init(argc, argv); |
170 | 170 |
171 // The exit manager is in charge of calling the dtors of singleton objects. | 171 // The exit manager is in charge of calling the dtors of singleton objects. |
172 base::AtExitManager exit_manager; | 172 base::AtExitManager exit_manager; |
173 | 173 |
174 ui::RegisterPathProvider(); | 174 ui::RegisterPathProvider(); |
175 icu_util::Initialize(); | 175 icu_util::Initialize(); |
176 ResourceBundle::InitSharedInstanceWithLocale("en-US", NULL); | 176 ResourceBundle::InitSharedInstanceWithLocale("en-US", NULL); |
177 | 177 |
178 return DemoMain(); | 178 return DemoMain(); |
179 } | 179 } |
OLD | NEW |