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/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" |
11 #include "ui/aura/client/default_capture_client.h" | 11 #include "ui/aura/client/default_capture_client.h" |
12 #include "ui/aura/client/stacking_client.h" | 12 #include "ui/aura/client/stacking_client.h" |
13 #include "ui/aura/env.h" | 13 #include "ui/aura/env.h" |
14 #include "ui/aura/root_window.h" | 14 #include "ui/aura/root_window.h" |
15 #include "ui/aura/single_display_manager.h" | 15 #include "ui/aura/test/test_screen.h" |
16 #include "ui/aura/window.h" | 16 #include "ui/aura/window.h" |
17 #include "ui/aura/window_delegate.h" | 17 #include "ui/aura/window_delegate.h" |
18 #include "ui/base/events/event.h" | 18 #include "ui/base/events/event.h" |
19 #include "ui/base/hit_test.h" | 19 #include "ui/base/hit_test.h" |
20 #include "ui/base/resource/resource_bundle.h" | 20 #include "ui/base/resource/resource_bundle.h" |
21 #include "ui/base/ui_base_paths.h" | 21 #include "ui/base/ui_base_paths.h" |
22 #include "ui/compositor/test/compositor_test_support.h" | 22 #include "ui/compositor/test/compositor_test_support.h" |
23 #include "ui/gfx/canvas.h" | 23 #include "ui/gfx/canvas.h" |
24 #include "ui/gfx/rect.h" | 24 #include "ui/gfx/rect.h" |
25 | 25 |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 | 114 |
115 scoped_ptr<aura::client::DefaultCaptureClient> capture_client_; | 115 scoped_ptr<aura::client::DefaultCaptureClient> capture_client_; |
116 | 116 |
117 DISALLOW_COPY_AND_ASSIGN(DemoStackingClient); | 117 DISALLOW_COPY_AND_ASSIGN(DemoStackingClient); |
118 }; | 118 }; |
119 | 119 |
120 int DemoMain() { | 120 int DemoMain() { |
121 // Create the message-loop here before creating the root window. | 121 // Create the message-loop here before creating the root window. |
122 MessageLoop message_loop(MessageLoop::TYPE_UI); | 122 MessageLoop message_loop(MessageLoop::TYPE_UI); |
123 ui::CompositorTestSupport::Initialize(); | 123 ui::CompositorTestSupport::Initialize(); |
124 aura::Env::GetInstance()->SetDisplayManager(new aura::SingleDisplayManager); | 124 aura::Env::GetInstance(); |
| 125 aura::TestScreen test_screen; |
| 126 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, &test_screen); |
125 scoped_ptr<aura::RootWindow> root_window( | 127 scoped_ptr<aura::RootWindow> root_window( |
126 aura::DisplayManager::CreateRootWindowForPrimaryDisplay()); | 128 test_screen.CreateRootWindowForPrimaryDisplay()); |
127 scoped_ptr<DemoStackingClient> stacking_client(new DemoStackingClient( | 129 scoped_ptr<DemoStackingClient> stacking_client(new DemoStackingClient( |
128 root_window.get())); | 130 root_window.get())); |
129 | 131 |
130 // Create a hierarchy of test windows. | 132 // Create a hierarchy of test windows. |
131 DemoWindowDelegate window_delegate1(SK_ColorBLUE); | 133 DemoWindowDelegate window_delegate1(SK_ColorBLUE); |
132 aura::Window window1(&window_delegate1); | 134 aura::Window window1(&window_delegate1); |
133 window1.set_id(1); | 135 window1.set_id(1); |
134 window1.Init(ui::LAYER_TEXTURED); | 136 window1.Init(ui::LAYER_TEXTURED); |
135 window1.SetBounds(gfx::Rect(100, 100, 400, 400)); | 137 window1.SetBounds(gfx::Rect(100, 100, 400, 400)); |
136 window1.Show(); | 138 window1.Show(); |
(...skipping 30 matching lines...) Expand all Loading... |
167 | 169 |
168 // The exit manager is in charge of calling the dtors of singleton objects. | 170 // The exit manager is in charge of calling the dtors of singleton objects. |
169 base::AtExitManager exit_manager; | 171 base::AtExitManager exit_manager; |
170 | 172 |
171 ui::RegisterPathProvider(); | 173 ui::RegisterPathProvider(); |
172 icu_util::Initialize(); | 174 icu_util::Initialize(); |
173 ResourceBundle::InitSharedInstanceWithLocale("en-US", NULL); | 175 ResourceBundle::InitSharedInstanceWithLocale("en-US", NULL); |
174 | 176 |
175 return DemoMain(); | 177 return DemoMain(); |
176 } | 178 } |
OLD | NEW |