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/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
11 #include "base/strings/string_split.h" | 11 #include "base/strings/string_split.h" |
12 #include "base/time/time.h" | 12 #include "base/time/time.h" |
13 #include "cc/output/context_provider.h" | 13 #include "cc/output/context_provider.h" |
14 #include "third_party/khronos/GLES2/gl2.h" | 14 #include "third_party/khronos/GLES2/gl2.h" |
15 #include "third_party/skia/include/core/SkXfermode.h" | 15 #include "third_party/skia/include/core/SkXfermode.h" |
16 #include "ui/aura/client/default_capture_client.h" | 16 #include "ui/aura/client/default_capture_client.h" |
17 #include "ui/aura/env.h" | 17 #include "ui/aura/env.h" |
18 #include "ui/aura/focus_manager.h" | |
19 #include "ui/aura/root_window.h" | 18 #include "ui/aura/root_window.h" |
| 19 #include "ui/aura/test/test_focus_client.h" |
20 #include "ui/aura/test/test_screen.h" | 20 #include "ui/aura/test/test_screen.h" |
21 #include "ui/aura/window.h" | 21 #include "ui/aura/window.h" |
22 #include "ui/base/hit_test.h" | 22 #include "ui/base/hit_test.h" |
23 #include "ui/base/resource/resource_bundle.h" | 23 #include "ui/base/resource/resource_bundle.h" |
24 #include "ui/base/ui_base_paths.h" | 24 #include "ui/base/ui_base_paths.h" |
25 #include "ui/compositor/compositor.h" | 25 #include "ui/compositor/compositor.h" |
26 #include "ui/compositor/compositor_observer.h" | 26 #include "ui/compositor/compositor_observer.h" |
27 #include "ui/compositor/debug_utils.h" | 27 #include "ui/compositor/debug_utils.h" |
28 #include "ui/compositor/layer.h" | 28 #include "ui/compositor/layer.h" |
29 #include "ui/gfx/canvas.h" | 29 #include "ui/gfx/canvas.h" |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 aura::Env::CreateInstance(); | 311 aura::Env::CreateInstance(); |
312 scoped_ptr<aura::TestScreen> test_screen( | 312 scoped_ptr<aura::TestScreen> test_screen( |
313 aura::TestScreen::CreateFullscreen()); | 313 aura::TestScreen::CreateFullscreen()); |
314 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, test_screen.get()); | 314 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, test_screen.get()); |
315 scoped_ptr<aura::RootWindow> root_window( | 315 scoped_ptr<aura::RootWindow> root_window( |
316 test_screen->CreateRootWindowForPrimaryDisplay()); | 316 test_screen->CreateRootWindowForPrimaryDisplay()); |
317 aura::client::SetCaptureClient( | 317 aura::client::SetCaptureClient( |
318 root_window.get(), | 318 root_window.get(), |
319 new aura::client::DefaultCaptureClient(root_window.get())); | 319 new aura::client::DefaultCaptureClient(root_window.get())); |
320 | 320 |
321 scoped_ptr<aura::client::FocusClient> focus_client(new aura::FocusManager); | 321 scoped_ptr<aura::client::FocusClient> focus_client( |
| 322 new aura::test::TestFocusClient); |
322 aura::client::SetFocusClient(root_window.get(), focus_client.get()); | 323 aura::client::SetFocusClient(root_window.get(), focus_client.get()); |
323 | 324 |
324 // add layers | 325 // add layers |
325 ColoredLayer background(SK_ColorRED); | 326 ColoredLayer background(SK_ColorRED); |
326 background.SetBounds(root_window->bounds()); | 327 background.SetBounds(root_window->bounds()); |
327 root_window->layer()->Add(&background); | 328 root_window->layer()->Add(&background); |
328 | 329 |
329 ColoredLayer window(SK_ColorBLUE); | 330 ColoredLayer window(SK_ColorBLUE); |
330 window.SetBounds(gfx::Rect(background.bounds().size())); | 331 window.SetBounds(gfx::Rect(background.bounds().size())); |
331 background.Add(&window); | 332 background.Add(&window); |
(...skipping 29 matching lines...) Expand all Loading... |
361 ui::PrintLayerHierarchy(root_window->layer(), gfx::Point(100, 100)); | 362 ui::PrintLayerHierarchy(root_window->layer(), gfx::Point(100, 100)); |
362 #endif | 363 #endif |
363 | 364 |
364 root_window->ShowRootWindow(); | 365 root_window->ShowRootWindow(); |
365 base::MessageLoopForUI::current()->Run(); | 366 base::MessageLoopForUI::current()->Run(); |
366 focus_client.reset(); | 367 focus_client.reset(); |
367 root_window.reset(); | 368 root_window.reset(); |
368 | 369 |
369 return 0; | 370 return 0; |
370 } | 371 } |
OLD | NEW |