| 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 "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 "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 MessageLoop message_loop(MessageLoop::TYPE_UI); | 140 MessageLoop message_loop(MessageLoop::TYPE_UI); |
| 141 | 141 |
| 142 aura::Desktop::GetInstance(); | 142 aura::Desktop::GetInstance(); |
| 143 | 143 |
| 144 // Create a hierarchy of test windows. | 144 // Create a hierarchy of test windows. |
| 145 DemoWindowDelegate window_delegate1(SK_ColorBLUE); | 145 DemoWindowDelegate window_delegate1(SK_ColorBLUE); |
| 146 aura::Window* window1 = new aura::Window(&window_delegate1); | 146 aura::Window* window1 = new aura::Window(&window_delegate1); |
| 147 window1->set_id(1); | 147 window1->set_id(1); |
| 148 window1->Init(); | 148 window1->Init(); |
| 149 window1->SetBounds(gfx::Rect(100, 100, 400, 400)); | 149 window1->SetBounds(gfx::Rect(100, 100, 400, 400)); |
| 150 window1->SetVisibility(aura::Window::VISIBILITY_SHOWN); | 150 window1->Show(); |
| 151 window1->SetParent(NULL); | 151 window1->SetParent(NULL); |
| 152 | 152 |
| 153 DemoWindowDelegate window_delegate2(SK_ColorRED); | 153 DemoWindowDelegate window_delegate2(SK_ColorRED); |
| 154 aura::Window* window2 = new aura::Window(&window_delegate2); | 154 aura::Window* window2 = new aura::Window(&window_delegate2); |
| 155 window2->set_id(2); | 155 window2->set_id(2); |
| 156 window2->Init(); | 156 window2->Init(); |
| 157 window2->SetBounds(gfx::Rect(200, 200, 350, 350)); | 157 window2->SetBounds(gfx::Rect(200, 200, 350, 350)); |
| 158 window2->SetVisibility(aura::Window::VISIBILITY_SHOWN); | 158 window2->Show(); |
| 159 window2->SetParent(NULL); | 159 window2->SetParent(NULL); |
| 160 | 160 |
| 161 DemoWindowDelegate window_delegate3(SK_ColorGREEN); | 161 DemoWindowDelegate window_delegate3(SK_ColorGREEN); |
| 162 aura::Window* window3 = new aura::Window(&window_delegate3); | 162 aura::Window* window3 = new aura::Window(&window_delegate3); |
| 163 window3->set_id(3); | 163 window3->set_id(3); |
| 164 window3->Init(); | 164 window3->Init(); |
| 165 window3->SetBounds(gfx::Rect(10, 10, 50, 50)); | 165 window3->SetBounds(gfx::Rect(10, 10, 50, 50)); |
| 166 window3->SetVisibility(aura::Window::VISIBILITY_SHOWN); | 166 window3->Show(); |
| 167 window3->SetParent(window2); | 167 window3->SetParent(window2); |
| 168 | 168 |
| 169 views::Widget* widget = new views::Widget; | 169 views::Widget* widget = new views::Widget; |
| 170 views::Widget::InitParams params(views::Widget::InitParams::TYPE_CONTROL); | 170 views::Widget::InitParams params(views::Widget::InitParams::TYPE_CONTROL); |
| 171 params.bounds = gfx::Rect(75, 75, 80, 80); | 171 params.bounds = gfx::Rect(75, 75, 80, 80); |
| 172 params.parent = window2; | 172 params.parent = window2; |
| 173 widget->Init(params); | 173 widget->Init(params); |
| 174 widget->SetContentsView(new TestView); | 174 widget->SetContentsView(new TestView); |
| 175 | 175 |
| 176 TestWindowContents* contents = new TestWindowContents; | 176 TestWindowContents* contents = new TestWindowContents; |
| 177 views::Widget* views_window = views::Widget::CreateWindowWithParentAndBounds( | 177 views::Widget* views_window = views::Widget::CreateWindowWithParentAndBounds( |
| 178 contents, window2, gfx::Rect(120, 150, 200, 200)); | 178 contents, window2, gfx::Rect(120, 150, 200, 200)); |
| 179 views_window->Show(); | 179 views_window->Show(); |
| 180 | 180 |
| 181 aura::Desktop::GetInstance()->Run(); | 181 aura::Desktop::GetInstance()->Run(); |
| 182 | 182 |
| 183 delete aura::Desktop::GetInstance(); | 183 delete aura::Desktop::GetInstance(); |
| 184 | 184 |
| 185 return 0; | 185 return 0; |
| 186 } | 186 } |
| 187 | 187 |
| OLD | NEW |