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