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/at_exit.h" | 8 #include "base/at_exit.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, screen_.get()); | 199 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, screen_.get()); |
200 | 200 |
201 NativeViewportPtr viewport; | 201 NativeViewportPtr viewport; |
202 app_->ConnectTo("mojo:mojo_native_viewport_service", &viewport); | 202 app_->ConnectTo("mojo:mojo_native_viewport_service", &viewport); |
203 | 203 |
204 window_tree_host_.reset(new WindowTreeHostMojo( | 204 window_tree_host_.reset(new WindowTreeHostMojo( |
205 viewport.Pass(), gfx::Rect(50, 50, 450, 60), | 205 viewport.Pass(), gfx::Rect(50, 50, 450, 60), |
206 base::Bind(&LauncherImpl::HostContextCreated, base::Unretained(this)))); | 206 base::Bind(&LauncherImpl::HostContextCreated, base::Unretained(this)))); |
207 } | 207 } |
208 | 208 |
209 // Overridden from InterfaceImpl: | |
210 virtual void OnConnectionError() OVERRIDE {} | |
211 | |
212 private: | 209 private: |
213 // Overridden from Launcher: | 210 // Overridden from Launcher: |
214 virtual void Show() OVERRIDE { | 211 virtual void Show() OVERRIDE { |
215 if (!window_tree_host_.get()) { | 212 if (!window_tree_host_.get()) { |
216 pending_show_ = true; | 213 pending_show_ = true; |
217 return; | 214 return; |
218 } | 215 } |
219 window_tree_host_->Show(); | 216 window_tree_host_->Show(); |
220 } | 217 } |
221 virtual void Hide() OVERRIDE { | 218 virtual void Hide() OVERRIDE { |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 // MessageLoop is not of TYPE_UI. I think we need a way to build | 284 // MessageLoop is not of TYPE_UI. I think we need a way to build |
288 // Aura that doesn't define platform-specific stuff. | 285 // Aura that doesn't define platform-specific stuff. |
289 aura::Env::CreateInstance(true); | 286 aura::Env::CreateInstance(true); |
290 | 287 |
291 mojo::Application app(shell_handle); | 288 mojo::Application app(shell_handle); |
292 app.AddService<mojo::examples::LauncherImpl>(&app); | 289 app.AddService<mojo::examples::LauncherImpl>(&app); |
293 | 290 |
294 loop.Run(); | 291 loop.Run(); |
295 return MOJO_RESULT_OK; | 292 return MOJO_RESULT_OK; |
296 } | 293 } |
OLD | NEW |