Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(84)

Side by Side Diff: shell/android/native_viewport_application_loader.h

Issue 1280613003: Allow native_viewport to create new native windows on demand on Android. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/common/binding_set.h"
8 #include "mojo/public/cpp/application/application_delegate.h" 9 #include "mojo/public/cpp/application/application_delegate.h"
9 #include "mojo/public/cpp/application/interface_factory.h" 10 #include "mojo/public/cpp/application/interface_factory.h"
10 #include "mojo/services/gpu/public/interfaces/gpu.mojom.h" 11 #include "mojo/services/gpu/public/interfaces/gpu.mojom.h"
11 #include "mojo/services/native_viewport/public/interfaces/native_viewport.mojom. h" 12 #include "mojo/services/native_viewport/public/interfaces/native_viewport.mojom. h"
12 #include "services/gles2/gpu_impl.h" 13 #include "services/gles2/gpu_impl.h"
13 #include "shell/application_manager/application_loader.h" 14 #include "shell/application_manager/application_loader.h"
14 15
15 namespace gles2 { 16 namespace gles2 {
16 class GpuState; 17 class GpuState;
17 } 18 }
18 19
19 namespace mojo { 20 namespace mojo {
20 class ApplicationImpl; 21 class ApplicationImpl;
21 } // namespace mojo 22 } // namespace mojo
22 23
24 namespace native_viewport {
25 class NativeViewportImpl;
26 } // namespace native_viewport
27
23 namespace shell { 28 namespace shell {
24 29
25 class NativeViewportApplicationLoader 30 class NativeViewportApplicationLoader
26 : public ApplicationLoader, 31 : public ApplicationLoader,
27 public mojo::ApplicationDelegate, 32 public mojo::ApplicationDelegate,
33 public mojo::NativeViewportShellService,
34 public mojo::InterfaceFactory<mojo::NativeViewportShellService>,
28 public mojo::InterfaceFactory<mojo::NativeViewport>, 35 public mojo::InterfaceFactory<mojo::NativeViewport>,
29 public mojo::InterfaceFactory<mojo::Gpu> { 36 public mojo::InterfaceFactory<mojo::Gpu> {
30 public: 37 public:
31 NativeViewportApplicationLoader(); 38 NativeViewportApplicationLoader();
32 ~NativeViewportApplicationLoader(); 39 ~NativeViewportApplicationLoader();
33 40
34 private: 41 private:
35 // ApplicationLoader implementation. 42 // ApplicationLoader implementation.
36 void Load( 43 void Load(
37 const GURL& url, 44 const GURL& url,
38 mojo::InterfaceRequest<mojo::Application> application_request) override; 45 mojo::InterfaceRequest<mojo::Application> application_request) override;
39 46
40 // mojo::ApplicationDelegate implementation. 47 // mojo::ApplicationDelegate implementation.
41 bool ConfigureIncomingConnection( 48 bool ConfigureIncomingConnection(
42 mojo::ApplicationConnection* connection) override; 49 mojo::ApplicationConnection* connection) override;
43 50
44 // mojo::InterfaceFactory<mojo::NativeViewport> implementation. 51 // mojo::InterfaceFactory<mojo::NativeViewport> implementation.
45 void Create(mojo::ApplicationConnection* connection, 52 void Create(mojo::ApplicationConnection* connection,
46 mojo::InterfaceRequest<mojo::NativeViewport> request) override; 53 mojo::InterfaceRequest<mojo::NativeViewport> request) override;
47 54
48 // mojo::InterfaceFactory<mojo::Gpu> implementation. 55 // mojo::InterfaceFactory<mojo::Gpu> implementation.
49 void Create(mojo::ApplicationConnection* connection, 56 void Create(mojo::ApplicationConnection* connection,
50 mojo::InterfaceRequest<mojo::Gpu> request) override; 57 mojo::InterfaceRequest<mojo::Gpu> request) override;
51 58
59 // mojo::InterfaceFactory<NativeViewportShellService> implementation.
60 void Create(
61 mojo::ApplicationConnection* connection,
62 mojo::InterfaceRequest<NativeViewportShellService> request) override;
63
64 // mojo::NativeViewportShellService implementation
65 void NewNativeSurfaceAvailable() override;
66
52 scoped_refptr<gles2::GpuState> gpu_state_; 67 scoped_refptr<gles2::GpuState> gpu_state_;
53 scoped_ptr<mojo::ApplicationImpl> app_; 68 scoped_ptr<mojo::ApplicationImpl> app_;
69 mojo::BindingSet<mojo::NativeViewportShellService>
70 native_viewport_shell_service_bindings_;
71 std::queue<base::WeakPtr<native_viewport::NativeViewportImpl>>
72 native_viewports_;
54 73
55 DISALLOW_COPY_AND_ASSIGN(NativeViewportApplicationLoader); 74 DISALLOW_COPY_AND_ASSIGN(NativeViewportApplicationLoader);
56 }; 75 };
57 76
58 } // namespace shell 77 } // namespace shell
59 78
60 #endif // MOJO_SHELL_ANDROID_NATIVE_VIEWPORT_APPLICATION_LOADER_H_ 79 #endif // MOJO_SHELL_ANDROID_NATIVE_VIEWPORT_APPLICATION_LOADER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698