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