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 #include "shell/android/keyboard_impl.h" | 10 #include "shell/android/keyboard_impl.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 const GURL& url, | 24 const GURL& url, |
25 InterfaceRequest<mojo::Application> application_request) { | 25 InterfaceRequest<mojo::Application> application_request) { |
26 DCHECK(application_request.is_pending()); | 26 DCHECK(application_request.is_pending()); |
27 app_.reset(new mojo::ApplicationImpl(this, application_request.Pass())); | 27 app_.reset(new mojo::ApplicationImpl(this, application_request.Pass())); |
28 } | 28 } |
29 | 29 |
30 bool NativeViewportApplicationLoader::ConfigureIncomingConnection( | 30 bool NativeViewportApplicationLoader::ConfigureIncomingConnection( |
31 ApplicationConnection* connection) { | 31 ApplicationConnection* connection) { |
32 connection->AddService<mojo::NativeViewport>(this); | 32 connection->AddService<mojo::NativeViewport>(this); |
33 connection->AddService<mojo::Gpu>(this); | 33 connection->AddService<mojo::Gpu>(this); |
34 connection->AddService<mojo::Keyboard>(this); | 34 connection->AddService<keyboard::KeyboardService>(this); |
35 return true; | 35 return true; |
36 } | 36 } |
37 | 37 |
38 void NativeViewportApplicationLoader::Create( | 38 void NativeViewportApplicationLoader::Create( |
39 ApplicationConnection* connection, | 39 ApplicationConnection* connection, |
40 InterfaceRequest<mojo::NativeViewport> request) { | 40 InterfaceRequest<mojo::NativeViewport> request) { |
41 if (!gpu_state_) | 41 if (!gpu_state_) |
42 gpu_state_ = new gles2::GpuState; | 42 gpu_state_ = new gles2::GpuState; |
43 new native_viewport::NativeViewportImpl(false, gpu_state_, request.Pass()); | 43 new native_viewport::NativeViewportImpl(false, gpu_state_, request.Pass()); |
44 } | 44 } |
45 | 45 |
46 void NativeViewportApplicationLoader::Create( | 46 void NativeViewportApplicationLoader::Create( |
47 ApplicationConnection* connection, | 47 ApplicationConnection* connection, |
48 InterfaceRequest<mojo::Keyboard> request) { | 48 InterfaceRequest<keyboard::KeyboardService> request) { |
49 new KeyboardImpl(request.Pass()); | 49 KeyboardImpl::CreateKeyboardImpl(request.Pass()); |
50 } | 50 } |
51 | 51 |
52 void NativeViewportApplicationLoader::Create( | 52 void NativeViewportApplicationLoader::Create( |
53 ApplicationConnection* connection, | 53 ApplicationConnection* connection, |
54 InterfaceRequest<mojo::Gpu> request) { | 54 InterfaceRequest<mojo::Gpu> request) { |
55 if (!gpu_state_) | 55 if (!gpu_state_) |
56 gpu_state_ = new gles2::GpuState; | 56 gpu_state_ = new gles2::GpuState; |
57 new gles2::GpuImpl(request.Pass(), gpu_state_); | 57 new gles2::GpuImpl(request.Pass(), gpu_state_); |
58 } | 58 } |
59 | 59 |
60 } // namespace shell | 60 } // namespace shell |
OLD | NEW |