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/bind.h" | 6 #include "base/bind.h" |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/i18n/icu_util.h" | 8 #include "base/i18n/icu_util.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 aura::Env::GetInstance(); | 301 aura::Env::GetInstance(); |
302 aura::SetUseFullscreenHostWindow(true); | 302 aura::SetUseFullscreenHostWindow(true); |
303 aura::TestScreen test_screen; | 303 aura::TestScreen test_screen; |
304 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, &test_screen); | 304 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, &test_screen); |
305 scoped_ptr<aura::RootWindow> root_window( | 305 scoped_ptr<aura::RootWindow> root_window( |
306 test_screen.CreateRootWindowForPrimaryDisplay()); | 306 test_screen.CreateRootWindowForPrimaryDisplay()); |
307 aura::client::SetCaptureClient( | 307 aura::client::SetCaptureClient( |
308 root_window.get(), | 308 root_window.get(), |
309 new aura::client::DefaultCaptureClient(root_window.get())); | 309 new aura::client::DefaultCaptureClient(root_window.get())); |
310 | 310 |
311 scoped_ptr<aura::FocusManager> focus_manager(new aura::FocusManager); | 311 scoped_ptr<aura::client::FocusClient> focus_client(new aura::FocusManager); |
312 root_window->set_focus_manager(focus_manager.get()); | 312 aura::client::SetFocusClient(root_window.get(), focus_client.get()); |
313 | 313 |
314 // add layers | 314 // add layers |
315 ColoredLayer background(SK_ColorRED); | 315 ColoredLayer background(SK_ColorRED); |
316 background.SetBounds(root_window->bounds()); | 316 background.SetBounds(root_window->bounds()); |
317 root_window->layer()->Add(&background); | 317 root_window->layer()->Add(&background); |
318 | 318 |
319 ColoredLayer window(SK_ColorBLUE); | 319 ColoredLayer window(SK_ColorBLUE); |
320 window.SetBounds(gfx::Rect(background.bounds().size())); | 320 window.SetBounds(gfx::Rect(background.bounds().size())); |
321 background.Add(&window); | 321 background.Add(&window); |
322 | 322 |
(...skipping 23 matching lines...) Expand all Loading... |
346 root_window->compositor(), | 346 root_window->compositor(), |
347 frames)); | 347 frames)); |
348 } | 348 } |
349 | 349 |
350 #ifndef NDEBUG | 350 #ifndef NDEBUG |
351 ui::PrintLayerHierarchy(root_window->layer(), gfx::Point(100, 100)); | 351 ui::PrintLayerHierarchy(root_window->layer(), gfx::Point(100, 100)); |
352 #endif | 352 #endif |
353 | 353 |
354 root_window->ShowRootWindow(); | 354 root_window->ShowRootWindow(); |
355 MessageLoopForUI::current()->Run(); | 355 MessageLoopForUI::current()->Run(); |
356 focus_manager.reset(); | 356 focus_client.reset(); |
357 root_window.reset(); | 357 root_window.reset(); |
358 | 358 |
359 ui::CompositorTestSupport::Terminate(); | 359 ui::CompositorTestSupport::Terminate(); |
360 | 360 |
361 return 0; | 361 return 0; |
362 } | 362 } |
OLD | NEW |