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" |
11 #include "base/string_split.h" | 11 #include "base/string_split.h" |
12 #include "base/time.h" | 12 #include "base/time.h" |
13 #include "third_party/khronos/GLES2/gl2.h" | 13 #include "third_party/khronos/GLES2/gl2.h" |
14 #include "third_party/skia/include/core/SkXfermode.h" | 14 #include "third_party/skia/include/core/SkXfermode.h" |
15 #include "ui/aura/client/default_capture_client.h" | 15 #include "ui/aura/client/default_capture_client.h" |
| 16 #include "ui/aura/display_util.h" |
16 #include "ui/aura/env.h" | 17 #include "ui/aura/env.h" |
17 #include "ui/aura/focus_manager.h" | 18 #include "ui/aura/focus_manager.h" |
18 #include "ui/aura/root_window.h" | 19 #include "ui/aura/root_window.h" |
19 #include "ui/aura/single_display_manager.h" | 20 #include "ui/aura/test/test_screen.h" |
20 #include "ui/aura/window.h" | 21 #include "ui/aura/window.h" |
21 #include "ui/base/hit_test.h" | 22 #include "ui/base/hit_test.h" |
22 #include "ui/base/resource/resource_bundle.h" | 23 #include "ui/base/resource/resource_bundle.h" |
23 #include "ui/base/ui_base_paths.h" | 24 #include "ui/base/ui_base_paths.h" |
24 #include "ui/compositor/compositor.h" | 25 #include "ui/compositor/compositor.h" |
25 #include "ui/compositor/compositor_observer.h" | 26 #include "ui/compositor/compositor_observer.h" |
26 #include "ui/compositor/debug_utils.h" | 27 #include "ui/compositor/debug_utils.h" |
27 #include "ui/compositor/layer.h" | 28 #include "ui/compositor/layer.h" |
28 #include "ui/compositor/test/compositor_test_support.h" | 29 #include "ui/compositor/test/compositor_test_support.h" |
29 #include "ui/gfx/canvas.h" | 30 #include "ui/gfx/canvas.h" |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 CommandLine::Init(argc, argv); | 291 CommandLine::Init(argc, argv); |
291 | 292 |
292 base::AtExitManager exit_manager; | 293 base::AtExitManager exit_manager; |
293 | 294 |
294 ui::RegisterPathProvider(); | 295 ui::RegisterPathProvider(); |
295 icu_util::Initialize(); | 296 icu_util::Initialize(); |
296 ResourceBundle::InitSharedInstanceWithLocale("en-US", NULL); | 297 ResourceBundle::InitSharedInstanceWithLocale("en-US", NULL); |
297 | 298 |
298 MessageLoop message_loop(MessageLoop::TYPE_UI); | 299 MessageLoop message_loop(MessageLoop::TYPE_UI); |
299 ui::CompositorTestSupport::Initialize(); | 300 ui::CompositorTestSupport::Initialize(); |
300 aura::SingleDisplayManager* manager = new aura::SingleDisplayManager; | 301 aura::Env::GetInstance(); |
301 manager->set_use_fullscreen_host_window(true); | 302 aura::SetUseFullscreenHostWindow(true); |
302 aura::Env::GetInstance()->SetDisplayManager(manager); | 303 aura::TestScreen test_screen; |
| 304 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, &test_screen); |
303 scoped_ptr<aura::RootWindow> root_window( | 305 scoped_ptr<aura::RootWindow> root_window( |
304 aura::DisplayManager::CreateRootWindowForPrimaryDisplay()); | 306 test_screen.CreateRootWindowForPrimaryDisplay()); |
305 aura::client::SetCaptureClient( | 307 aura::client::SetCaptureClient( |
306 root_window.get(), | 308 root_window.get(), |
307 new aura::client::DefaultCaptureClient(root_window.get())); | 309 new aura::client::DefaultCaptureClient(root_window.get())); |
308 | 310 |
309 scoped_ptr<aura::FocusManager> focus_manager(new aura::FocusManager); | 311 scoped_ptr<aura::FocusManager> focus_manager(new aura::FocusManager); |
310 root_window->set_focus_manager(focus_manager.get()); | 312 root_window->set_focus_manager(focus_manager.get()); |
311 | 313 |
312 // add layers | 314 // add layers |
313 ColoredLayer background(SK_ColorRED); | 315 ColoredLayer background(SK_ColorRED); |
314 background.SetBounds(root_window->bounds()); | 316 background.SetBounds(root_window->bounds()); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 | 353 |
352 root_window->ShowRootWindow(); | 354 root_window->ShowRootWindow(); |
353 MessageLoopForUI::current()->Run(); | 355 MessageLoopForUI::current()->Run(); |
354 focus_manager.reset(); | 356 focus_manager.reset(); |
355 root_window.reset(); | 357 root_window.reset(); |
356 | 358 |
357 ui::CompositorTestSupport::Terminate(); | 359 ui::CompositorTestSupport::Terminate(); |
358 | 360 |
359 return 0; | 361 return 0; |
360 } | 362 } |
OLD | NEW |