OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <stdio.h> | 5 #include <stdio.h> |
6 #include <string> | 6 #include <string> |
7 | 7 |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "mojo/application/application_runner_chromium.h" | 9 #include "mojo/application/application_runner_chromium.h" |
10 #include "mojo/aura/context_factory_mojo.h" | 10 #include "mojo/aura/context_factory_mojo.h" |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 virtual void OnViewManagerDisconnected( | 154 virtual void OnViewManagerDisconnected( |
155 mojo::ViewManager* view_manager) OVERRIDE { | 155 mojo::ViewManager* view_manager) OVERRIDE { |
156 base::MessageLoop::current()->Quit(); | 156 base::MessageLoop::current()->Quit(); |
157 } | 157 } |
158 | 158 |
159 // WindowTreeHostMojoDelegate: | 159 // WindowTreeHostMojoDelegate: |
160 virtual void CompositorContentsChanged(const SkBitmap& bitmap) OVERRIDE { | 160 virtual void CompositorContentsChanged(const SkBitmap& bitmap) OVERRIDE { |
161 root_->SetContents(bitmap); | 161 root_->SetContents(bitmap); |
162 } | 162 } |
163 | 163 |
164 virtual void Initialize(mojo::ApplicationImpl* app) MOJO_OVERRIDE { | 164 virtual void Initialize(mojo::ApplicationImpl* app) override { |
165 view_manager_client_factory_.reset( | 165 view_manager_client_factory_.reset( |
166 new mojo::ViewManagerClientFactory(app->shell(), this)); | 166 new mojo::ViewManagerClientFactory(app->shell(), this)); |
167 aura::Env::CreateInstance(true); | 167 aura::Env::CreateInstance(true); |
168 context_factory_.reset(new mojo::ContextFactoryMojo); | 168 context_factory_.reset(new mojo::ContextFactoryMojo); |
169 aura::Env::GetInstance()->set_context_factory(context_factory_.get()); | 169 aura::Env::GetInstance()->set_context_factory(context_factory_.get()); |
170 screen_.reset(mojo::ScreenMojo::Create()); | 170 screen_.reset(mojo::ScreenMojo::Create()); |
171 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, screen_.get()); | 171 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, screen_.get()); |
172 } | 172 } |
173 | 173 |
174 virtual bool ConfigureIncomingConnection( | 174 virtual bool ConfigureIncomingConnection( |
175 mojo::ApplicationConnection* connection) MOJO_OVERRIDE { | 175 mojo::ApplicationConnection* connection) override { |
176 connection->AddService(view_manager_client_factory_.get()); | 176 connection->AddService(view_manager_client_factory_.get()); |
177 return true; | 177 return true; |
178 } | 178 } |
179 | 179 |
180 scoped_ptr<DemoWindowTreeClient> window_tree_client_; | 180 scoped_ptr<DemoWindowTreeClient> window_tree_client_; |
181 | 181 |
182 scoped_ptr<ui::ContextFactory> context_factory_; | 182 scoped_ptr<ui::ContextFactory> context_factory_; |
183 | 183 |
184 scoped_ptr<mojo::ScreenMojo> screen_; | 184 scoped_ptr<mojo::ScreenMojo> screen_; |
185 | 185 |
(...skipping 13 matching lines...) Expand all Loading... |
199 | 199 |
200 DISALLOW_COPY_AND_ASSIGN(AuraDemo); | 200 DISALLOW_COPY_AND_ASSIGN(AuraDemo); |
201 }; | 201 }; |
202 | 202 |
203 } // namespace examples | 203 } // namespace examples |
204 | 204 |
205 MojoResult MojoMain(MojoHandle shell_handle) { | 205 MojoResult MojoMain(MojoHandle shell_handle) { |
206 mojo::ApplicationRunnerChromium runner(new examples::AuraDemo); | 206 mojo::ApplicationRunnerChromium runner(new examples::AuraDemo); |
207 return runner.Run(shell_handle); | 207 return runner.Run(shell_handle); |
208 } | 208 } |
OLD | NEW |