OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "shell/android/native_viewport_application_loader.h" | 5 #include "shell/android/native_viewport_application_loader.h" |
6 | 6 |
7 #include "mojo/public/cpp/application/application_impl.h" | 7 #include "mojo/public/cpp/application/application_impl.h" |
8 #include "services/gles2/gpu_state.h" | 8 #include "services/gles2/gpu_state.h" |
9 #include "services/native_viewport/native_viewport_impl.h" | 9 #include "services/native_viewport/native_viewport_impl.h" |
10 | 10 |
11 using mojo::ApplicationConnection; | 11 using mojo::ApplicationConnection; |
| 12 using mojo::ConnectionContext; |
12 using mojo::InterfaceRequest; | 13 using mojo::InterfaceRequest; |
13 | 14 |
14 namespace shell { | 15 namespace shell { |
15 | 16 |
16 NativeViewportApplicationLoader::NativeViewportApplicationLoader() { | 17 NativeViewportApplicationLoader::NativeViewportApplicationLoader() { |
17 } | 18 } |
18 | 19 |
19 NativeViewportApplicationLoader::~NativeViewportApplicationLoader() { | 20 NativeViewportApplicationLoader::~NativeViewportApplicationLoader() { |
20 } | 21 } |
21 | 22 |
22 void NativeViewportApplicationLoader::Load( | 23 void NativeViewportApplicationLoader::Load( |
23 const GURL& url, | 24 const GURL& url, |
24 InterfaceRequest<mojo::Application> application_request) { | 25 InterfaceRequest<mojo::Application> application_request) { |
25 DCHECK(application_request.is_pending()); | 26 DCHECK(application_request.is_pending()); |
26 app_.reset(new mojo::ApplicationImpl(this, application_request.Pass())); | 27 app_.reset(new mojo::ApplicationImpl(this, application_request.Pass())); |
27 } | 28 } |
28 | 29 |
29 bool NativeViewportApplicationLoader::ConfigureIncomingConnection( | 30 bool NativeViewportApplicationLoader::ConfigureIncomingConnection( |
30 ApplicationConnection* connection) { | 31 ApplicationConnection* connection) { |
31 connection->AddService<mojo::NativeViewport>(this); | 32 connection->AddService<mojo::NativeViewport>(this); |
32 connection->AddService<mojo::Gpu>(this); | 33 connection->AddService<mojo::Gpu>(this); |
33 return true; | 34 return true; |
34 } | 35 } |
35 | 36 |
36 void NativeViewportApplicationLoader::Create( | 37 void NativeViewportApplicationLoader::Create( |
37 ApplicationConnection* connection, | 38 const ConnectionContext& connection_context, |
38 InterfaceRequest<mojo::NativeViewport> request) { | 39 InterfaceRequest<mojo::NativeViewport> request) { |
39 if (!gpu_state_) | 40 if (!gpu_state_) |
40 gpu_state_ = new gles2::GpuState; | 41 gpu_state_ = new gles2::GpuState; |
41 new native_viewport::NativeViewportImpl(app_.get(), false, gpu_state_, | 42 new native_viewport::NativeViewportImpl(app_.get(), false, gpu_state_, |
42 request.Pass()); | 43 request.Pass()); |
43 } | 44 } |
44 | 45 |
45 void NativeViewportApplicationLoader::Create( | 46 void NativeViewportApplicationLoader::Create( |
46 ApplicationConnection* connection, | 47 const ConnectionContext& connection_context, |
47 InterfaceRequest<mojo::Gpu> request) { | 48 InterfaceRequest<mojo::Gpu> request) { |
48 if (!gpu_state_) | 49 if (!gpu_state_) |
49 gpu_state_ = new gles2::GpuState; | 50 gpu_state_ = new gles2::GpuState; |
50 new gles2::GpuImpl(request.Pass(), gpu_state_); | 51 new gles2::GpuImpl(request.Pass(), gpu_state_); |
51 } | 52 } |
52 | 53 |
53 } // namespace shell | 54 } // namespace shell |
OLD | NEW |