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 #ifndef MOJO_SHELL_ANDROID_NATIVE_VIEWPORT_APPLICATION_LOADER_H_ | 5 #ifndef MOJO_SHELL_ANDROID_NATIVE_VIEWPORT_APPLICATION_LOADER_H_ |
6 #define MOJO_SHELL_ANDROID_NATIVE_VIEWPORT_APPLICATION_LOADER_H_ | 6 #define MOJO_SHELL_ANDROID_NATIVE_VIEWPORT_APPLICATION_LOADER_H_ |
7 | 7 |
8 #include "mojo/public/cpp/application/application_delegate.h" | 8 #include "mojo/public/cpp/application/application_delegate.h" |
9 #include "mojo/public/cpp/application/interface_factory.h" | |
10 #include "mojo/services/gpu/interfaces/gpu.mojom.h" | 9 #include "mojo/services/gpu/interfaces/gpu.mojom.h" |
11 #include "mojo/services/native_viewport/interfaces/native_viewport.mojom.h" | 10 #include "mojo/services/native_viewport/interfaces/native_viewport.mojom.h" |
12 #include "services/gles2/gpu_impl.h" | 11 #include "services/gles2/gpu_impl.h" |
13 #include "shell/application_manager/application_loader.h" | 12 #include "shell/application_manager/application_loader.h" |
14 | 13 |
15 namespace gles2 { | 14 namespace gles2 { |
16 class GpuState; | 15 class GpuState; |
17 } | 16 } |
18 | 17 |
19 namespace mojo { | 18 namespace mojo { |
20 class ApplicationImpl; | 19 class ApplicationImpl; |
21 } // namespace mojo | 20 } // namespace mojo |
22 | 21 |
23 namespace shell { | 22 namespace shell { |
24 | 23 |
25 class NativeViewportApplicationLoader | 24 class NativeViewportApplicationLoader : public ApplicationLoader, |
26 : public ApplicationLoader, | 25 public mojo::ApplicationDelegate { |
27 public mojo::ApplicationDelegate, | |
28 public mojo::InterfaceFactory<mojo::NativeViewport>, | |
29 public mojo::InterfaceFactory<mojo::Gpu> { | |
30 public: | 26 public: |
31 NativeViewportApplicationLoader(); | 27 NativeViewportApplicationLoader(); |
32 ~NativeViewportApplicationLoader(); | 28 ~NativeViewportApplicationLoader(); |
33 | 29 |
34 private: | 30 private: |
35 // ApplicationLoader implementation. | 31 // ApplicationLoader implementation. |
36 void Load( | 32 void Load( |
37 const GURL& url, | 33 const GURL& url, |
38 mojo::InterfaceRequest<mojo::Application> application_request) override; | 34 mojo::InterfaceRequest<mojo::Application> application_request) override; |
39 | 35 |
40 // mojo::ApplicationDelegate implementation. | 36 // mojo::ApplicationDelegate implementation. |
41 bool ConfigureIncomingConnection( | 37 bool ConfigureIncomingConnection( |
42 mojo::ApplicationConnection* connection) override; | 38 mojo::ApplicationConnection* connection) override; |
43 | 39 |
44 // mojo::InterfaceFactory<mojo::NativeViewport> implementation. | |
45 void Create(const mojo::ConnectionContext& connection_context, | |
46 mojo::InterfaceRequest<mojo::NativeViewport> request) override; | |
47 | |
48 // mojo::InterfaceFactory<mojo::Gpu> implementation. | |
49 void Create(const mojo::ConnectionContext& connection_context, | |
50 mojo::InterfaceRequest<mojo::Gpu> request) override; | |
51 | |
52 scoped_refptr<gles2::GpuState> gpu_state_; | 40 scoped_refptr<gles2::GpuState> gpu_state_; |
53 scoped_ptr<mojo::ApplicationImpl> app_; | 41 scoped_ptr<mojo::ApplicationImpl> app_; |
54 | 42 |
55 DISALLOW_COPY_AND_ASSIGN(NativeViewportApplicationLoader); | 43 DISALLOW_COPY_AND_ASSIGN(NativeViewportApplicationLoader); |
56 }; | 44 }; |
57 | 45 |
58 } // namespace shell | 46 } // namespace shell |
59 | 47 |
60 #endif // MOJO_SHELL_ANDROID_NATIVE_VIEWPORT_APPLICATION_LOADER_H_ | 48 #endif // MOJO_SHELL_ANDROID_NATIVE_VIEWPORT_APPLICATION_LOADER_H_ |
OLD | NEW |