Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(570)

Side by Side Diff: ui/aura/demo/demo_main.cc

Issue 11421006: Desktop aura: Break aura::Window::SetParent in two. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix ash_unittests Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/aura/client/stacking_client.h ('k') | ui/aura/gestures/gesture_recognizer_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 scoped_ptr<DemoStackingClient> stacking_client(new DemoStackingClient( 135 scoped_ptr<DemoStackingClient> stacking_client(new DemoStackingClient(
136 root_window.get())); 136 root_window.get()));
137 137
138 // Create a hierarchy of test windows. 138 // Create a hierarchy of test windows.
139 DemoWindowDelegate window_delegate1(SK_ColorBLUE); 139 DemoWindowDelegate window_delegate1(SK_ColorBLUE);
140 aura::Window window1(&window_delegate1); 140 aura::Window window1(&window_delegate1);
141 window1.set_id(1); 141 window1.set_id(1);
142 window1.Init(ui::LAYER_TEXTURED); 142 window1.Init(ui::LAYER_TEXTURED);
143 window1.SetBounds(gfx::Rect(100, 100, 400, 400)); 143 window1.SetBounds(gfx::Rect(100, 100, 400, 400));
144 window1.Show(); 144 window1.Show();
145 window1.SetParent(NULL); 145 window1.SetDefaultParentByRootWindow(root_window.get(), gfx::Rect());
146 146
147 DemoWindowDelegate window_delegate2(SK_ColorRED); 147 DemoWindowDelegate window_delegate2(SK_ColorRED);
148 aura::Window window2(&window_delegate2); 148 aura::Window window2(&window_delegate2);
149 window2.set_id(2); 149 window2.set_id(2);
150 window2.Init(ui::LAYER_TEXTURED); 150 window2.Init(ui::LAYER_TEXTURED);
151 window2.SetBounds(gfx::Rect(200, 200, 350, 350)); 151 window2.SetBounds(gfx::Rect(200, 200, 350, 350));
152 window2.Show(); 152 window2.Show();
153 window2.SetParent(NULL); 153 window2.SetDefaultParentByRootWindow(root_window.get(), gfx::Rect());
154 154
155 DemoWindowDelegate window_delegate3(SK_ColorGREEN); 155 DemoWindowDelegate window_delegate3(SK_ColorGREEN);
156 aura::Window window3(&window_delegate3); 156 aura::Window window3(&window_delegate3);
157 window3.set_id(3); 157 window3.set_id(3);
158 window3.Init(ui::LAYER_TEXTURED); 158 window3.Init(ui::LAYER_TEXTURED);
159 window3.SetBounds(gfx::Rect(10, 10, 50, 50)); 159 window3.SetBounds(gfx::Rect(10, 10, 50, 50));
160 window3.Show(); 160 window3.Show();
161 window3.SetParent(&window2); 161 window2.AddChild(&window3);
162 162
163 root_window->ShowRootWindow(); 163 root_window->ShowRootWindow();
164 MessageLoopForUI::current()->Run(); 164 MessageLoopForUI::current()->Run();
165 165
166 ui::CompositorTestSupport::Terminate(); 166 ui::CompositorTestSupport::Terminate();
167 167
168 return 0; 168 return 0;
169 } 169 }
170 170
171 } // namespace 171 } // namespace
172 172
173 int main(int argc, char** argv) { 173 int main(int argc, char** argv) {
174 CommandLine::Init(argc, argv); 174 CommandLine::Init(argc, argv);
175 175
176 // The exit manager is in charge of calling the dtors of singleton objects. 176 // The exit manager is in charge of calling the dtors of singleton objects.
177 base::AtExitManager exit_manager; 177 base::AtExitManager exit_manager;
178 178
179 ui::RegisterPathProvider(); 179 ui::RegisterPathProvider();
180 icu_util::Initialize(); 180 icu_util::Initialize();
181 ResourceBundle::InitSharedInstanceWithLocale("en-US", NULL); 181 ResourceBundle::InitSharedInstanceWithLocale("en-US", NULL);
182 182
183 return DemoMain(); 183 return DemoMain();
184 } 184 }
OLDNEW
« no previous file with comments | « ui/aura/client/stacking_client.h ('k') | ui/aura/gestures/gesture_recognizer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698