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/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "third_party/skia/include/core/SkXfermode.h" | 10 #include "third_party/skia/include/core/SkXfermode.h" |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 test_screen->CreateRootWindowForPrimaryDisplay()); | 119 test_screen->CreateRootWindowForPrimaryDisplay()); |
120 scoped_ptr<DemoWindowTreeClient> window_tree_client(new DemoWindowTreeClient( | 120 scoped_ptr<DemoWindowTreeClient> window_tree_client(new DemoWindowTreeClient( |
121 root_window->window())); | 121 root_window->window())); |
122 aura::test::TestFocusClient focus_client; | 122 aura::test::TestFocusClient focus_client; |
123 aura::client::SetFocusClient(root_window->window(), &focus_client); | 123 aura::client::SetFocusClient(root_window->window(), &focus_client); |
124 | 124 |
125 // Create a hierarchy of test windows. | 125 // Create a hierarchy of test windows. |
126 DemoWindowDelegate window_delegate1(SK_ColorBLUE); | 126 DemoWindowDelegate window_delegate1(SK_ColorBLUE); |
127 aura::Window window1(&window_delegate1); | 127 aura::Window window1(&window_delegate1); |
128 window1.set_id(1); | 128 window1.set_id(1); |
129 window1.Init(ui::LAYER_TEXTURED); | 129 window1.Init(aura::WINDOW_LAYER_TEXTURED); |
130 window1.SetBounds(gfx::Rect(100, 100, 400, 400)); | 130 window1.SetBounds(gfx::Rect(100, 100, 400, 400)); |
131 window1.Show(); | 131 window1.Show(); |
132 aura::client::ParentWindowWithContext( | 132 aura::client::ParentWindowWithContext( |
133 &window1, root_window->window(), gfx::Rect()); | 133 &window1, root_window->window(), gfx::Rect()); |
134 | 134 |
135 DemoWindowDelegate window_delegate2(SK_ColorRED); | 135 DemoWindowDelegate window_delegate2(SK_ColorRED); |
136 aura::Window window2(&window_delegate2); | 136 aura::Window window2(&window_delegate2); |
137 window2.set_id(2); | 137 window2.set_id(2); |
138 window2.Init(ui::LAYER_TEXTURED); | 138 window2.Init(aura::WINDOW_LAYER_TEXTURED); |
139 window2.SetBounds(gfx::Rect(200, 200, 350, 350)); | 139 window2.SetBounds(gfx::Rect(200, 200, 350, 350)); |
140 window2.Show(); | 140 window2.Show(); |
141 aura::client::ParentWindowWithContext( | 141 aura::client::ParentWindowWithContext( |
142 &window2, root_window->window(), gfx::Rect()); | 142 &window2, root_window->window(), gfx::Rect()); |
143 | 143 |
144 DemoWindowDelegate window_delegate3(SK_ColorGREEN); | 144 DemoWindowDelegate window_delegate3(SK_ColorGREEN); |
145 aura::Window window3(&window_delegate3); | 145 aura::Window window3(&window_delegate3); |
146 window3.set_id(3); | 146 window3.set_id(3); |
147 window3.Init(ui::LAYER_TEXTURED); | 147 window3.Init(aura::WINDOW_LAYER_TEXTURED); |
148 window3.SetBounds(gfx::Rect(10, 10, 50, 50)); | 148 window3.SetBounds(gfx::Rect(10, 10, 50, 50)); |
149 window3.Show(); | 149 window3.Show(); |
150 window2.AddChild(&window3); | 150 window2.AddChild(&window3); |
151 | 151 |
152 root_window->host()->Show(); | 152 root_window->host()->Show(); |
153 base::MessageLoopForUI::current()->Run(); | 153 base::MessageLoopForUI::current()->Run(); |
154 | 154 |
155 return 0; | 155 return 0; |
156 } | 156 } |
157 | 157 |
158 } // namespace | 158 } // namespace |
159 | 159 |
160 int main(int argc, char** argv) { | 160 int main(int argc, char** argv) { |
161 CommandLine::Init(argc, argv); | 161 CommandLine::Init(argc, argv); |
162 | 162 |
163 // The exit manager is in charge of calling the dtors of singleton objects. | 163 // The exit manager is in charge of calling the dtors of singleton objects. |
164 base::AtExitManager exit_manager; | 164 base::AtExitManager exit_manager; |
165 | 165 |
166 base::i18n::InitializeICU(); | 166 base::i18n::InitializeICU(); |
167 | 167 |
168 return DemoMain(); | 168 return DemoMain(); |
169 } | 169 } |
OLD | NEW |