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 #if defined(USE_X11) | 5 #if defined(USE_X11) |
6 #include <X11/Xlib.h> | 6 #include <X11/Xlib.h> |
7 #endif | 7 #endif |
8 | 8 |
9 #include "base/at_exit.h" | 9 #include "base/at_exit.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 ui::ContextFactory::SetInstance(context_factory.get()); | 302 ui::ContextFactory::SetInstance(context_factory.get()); |
303 | 303 |
304 base::i18n::InitializeICU(); | 304 base::i18n::InitializeICU(); |
305 | 305 |
306 base::MessageLoopForUI message_loop; | 306 base::MessageLoopForUI message_loop; |
307 aura::Env::CreateInstance(true); | 307 aura::Env::CreateInstance(true); |
308 scoped_ptr<aura::TestScreen> test_screen( | 308 scoped_ptr<aura::TestScreen> test_screen( |
309 aura::TestScreen::CreateFullscreen()); | 309 aura::TestScreen::CreateFullscreen()); |
310 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, test_screen.get()); | 310 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, test_screen.get()); |
311 scoped_ptr<aura::WindowTreeHost> host( | 311 scoped_ptr<aura::WindowTreeHost> host( |
312 test_screen->CreateHostForPrimaryDisplay()); | 312 test_screen->CreateHostForPrimaryDisplay(context_factory.get())); |
313 aura::client::SetCaptureClient( | 313 aura::client::SetCaptureClient( |
314 host->window(), | 314 host->window(), |
315 new aura::client::DefaultCaptureClient(host->window())); | 315 new aura::client::DefaultCaptureClient(host->window())); |
316 | 316 |
317 scoped_ptr<aura::client::FocusClient> focus_client( | 317 scoped_ptr<aura::client::FocusClient> focus_client( |
318 new aura::test::TestFocusClient); | 318 new aura::test::TestFocusClient); |
319 aura::client::SetFocusClient(host->window(), focus_client.get()); | 319 aura::client::SetFocusClient(host->window(), focus_client.get()); |
320 | 320 |
321 // add layers | 321 // add layers |
322 ColoredLayer background(SK_ColorRED); | 322 ColoredLayer background(SK_ColorRED); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 ui::PrintLayerHierarchy(host->window()->layer(), gfx::Point(100, 100)); | 358 ui::PrintLayerHierarchy(host->window()->layer(), gfx::Point(100, 100)); |
359 #endif | 359 #endif |
360 | 360 |
361 host->Show(); | 361 host->Show(); |
362 base::MessageLoopForUI::current()->Run(); | 362 base::MessageLoopForUI::current()->Run(); |
363 focus_client.reset(); | 363 focus_client.reset(); |
364 host.reset(); | 364 host.reset(); |
365 | 365 |
366 return 0; | 366 return 0; |
367 } | 367 } |
OLD | NEW |