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" |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 private: | 102 private: |
103 aura::RootWindow* root_window_; | 103 aura::RootWindow* root_window_; |
104 | 104 |
105 scoped_ptr<aura::client::DefaultCaptureClient> capture_client_; | 105 scoped_ptr<aura::client::DefaultCaptureClient> capture_client_; |
106 | 106 |
107 DISALLOW_COPY_AND_ASSIGN(DemoStackingClient); | 107 DISALLOW_COPY_AND_ASSIGN(DemoStackingClient); |
108 }; | 108 }; |
109 | 109 |
110 int DemoMain() { | 110 int DemoMain() { |
111 // Create the message-loop here before creating the root window. | 111 // Create the message-loop here before creating the root window. |
112 MessageLoop message_loop(MessageLoop::TYPE_UI); | 112 base::MessageLoop message_loop(base::MessageLoop::TYPE_UI); |
113 ui::CompositorTestSupport::Initialize(); | 113 ui::CompositorTestSupport::Initialize(); |
114 aura::Env::GetInstance(); | 114 aura::Env::GetInstance(); |
115 scoped_ptr<aura::TestScreen> test_screen(aura::TestScreen::Create()); | 115 scoped_ptr<aura::TestScreen> test_screen(aura::TestScreen::Create()); |
116 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, test_screen.get()); | 116 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, test_screen.get()); |
117 scoped_ptr<aura::RootWindow> root_window( | 117 scoped_ptr<aura::RootWindow> root_window( |
118 test_screen->CreateRootWindowForPrimaryDisplay()); | 118 test_screen->CreateRootWindowForPrimaryDisplay()); |
119 scoped_ptr<DemoStackingClient> stacking_client(new DemoStackingClient( | 119 scoped_ptr<DemoStackingClient> stacking_client(new DemoStackingClient( |
120 root_window.get())); | 120 root_window.get())); |
121 | 121 |
122 // Create a hierarchy of test windows. | 122 // Create a hierarchy of test windows. |
(...skipping 15 matching lines...) Expand all Loading... |
138 | 138 |
139 DemoWindowDelegate window_delegate3(SK_ColorGREEN); | 139 DemoWindowDelegate window_delegate3(SK_ColorGREEN); |
140 aura::Window window3(&window_delegate3); | 140 aura::Window window3(&window_delegate3); |
141 window3.set_id(3); | 141 window3.set_id(3); |
142 window3.Init(ui::LAYER_TEXTURED); | 142 window3.Init(ui::LAYER_TEXTURED); |
143 window3.SetBounds(gfx::Rect(10, 10, 50, 50)); | 143 window3.SetBounds(gfx::Rect(10, 10, 50, 50)); |
144 window3.Show(); | 144 window3.Show(); |
145 window2.AddChild(&window3); | 145 window2.AddChild(&window3); |
146 | 146 |
147 root_window->ShowRootWindow(); | 147 root_window->ShowRootWindow(); |
148 MessageLoopForUI::current()->Run(); | 148 base::MessageLoopForUI::current()->Run(); |
149 | 149 |
150 ui::CompositorTestSupport::Terminate(); | 150 ui::CompositorTestSupport::Terminate(); |
151 | 151 |
152 return 0; | 152 return 0; |
153 } | 153 } |
154 | 154 |
155 } // namespace | 155 } // namespace |
156 | 156 |
157 int main(int argc, char** argv) { | 157 int main(int argc, char** argv) { |
158 CommandLine::Init(argc, argv); | 158 CommandLine::Init(argc, argv); |
159 | 159 |
160 // The exit manager is in charge of calling the dtors of singleton objects. | 160 // The exit manager is in charge of calling the dtors of singleton objects. |
161 base::AtExitManager exit_manager; | 161 base::AtExitManager exit_manager; |
162 | 162 |
163 ui::RegisterPathProvider(); | 163 ui::RegisterPathProvider(); |
164 icu_util::Initialize(); | 164 icu_util::Initialize(); |
165 ResourceBundle::InitSharedInstanceWithLocale("en-US", NULL); | 165 ResourceBundle::InitSharedInstanceWithLocale("en-US", NULL); |
166 | 166 |
167 return DemoMain(); | 167 return DemoMain(); |
168 } | 168 } |
OLD | NEW |