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 COMPONENTS_MUS_VIEW_MANAGER_APP_H_ | 5 #ifndef COMPONENTS_MUS_VIEW_MANAGER_APP_H_ |
6 #define COMPONENTS_MUS_VIEW_MANAGER_APP_H_ | 6 #define COMPONENTS_MUS_VIEW_MANAGER_APP_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "cc/surfaces/surface_manager.h" | 11 #include "cc/surfaces/surface_manager.h" |
12 #include "components/mus/connection_manager_delegate.h" | 12 #include "components/mus/connection_manager_delegate.h" |
13 #include "components/mus/public/interfaces/gpu.mojom.h" | 13 #include "components/mus/public/interfaces/gpu.mojom.h" |
14 #include "components/mus/public/interfaces/view_tree.mojom.h" | 14 #include "components/mus/public/interfaces/view_tree.mojom.h" |
15 #include "components/mus/public/interfaces/view_tree_host.mojom.h" | 15 #include "components/mus/public/interfaces/view_tree_host.mojom.h" |
16 #include "mojo/application/public/cpp/app_lifetime_helper.h" | 16 #include "mojo/application/public/cpp/app_lifetime_helper.h" |
17 #include "mojo/application/public/cpp/application_delegate.h" | 17 #include "mojo/application/public/cpp/application_delegate.h" |
18 #include "mojo/application/public/cpp/interface_factory.h" | 18 #include "mojo/application/public/cpp/interface_factory.h" |
19 #include "mojo/common/tracing_impl.h" | 19 #include "mojo/common/tracing_impl.h" |
20 #include "mojo/common/weak_binding_set.h" | 20 #include "mojo/common/weak_binding_set.h" |
21 | 21 |
22 namespace gles2 { | |
23 class GpuState; | |
24 } | |
25 | |
26 namespace mojo { | 22 namespace mojo { |
27 class ApplicationImpl; | 23 class ApplicationImpl; |
28 } | 24 } |
29 | 25 |
30 namespace surfaces { | |
31 class SurfacesScheduler; | |
32 class SurfacesState; | |
33 } | |
34 | |
35 namespace ui { | 26 namespace ui { |
36 class PlatformEventSource; | 27 class PlatformEventSource; |
37 } | 28 } |
38 | 29 |
39 namespace view_manager { | 30 namespace mus { |
40 | 31 |
41 class ConnectionManager; | 32 class ConnectionManager; |
| 33 class GpuState; |
| 34 class SurfacesScheduler; |
| 35 class SurfacesState; |
42 | 36 |
43 class ViewManagerApp : public mojo::ApplicationDelegate, | 37 class MandolineUIServicesApp |
44 public ConnectionManagerDelegate, | 38 : public mojo::ApplicationDelegate, |
45 public mojo::InterfaceFactory<mojo::ViewTreeHostFactory>, | 39 public ConnectionManagerDelegate, |
46 public mojo::InterfaceFactory<mojo::Gpu>, | 40 public mojo::InterfaceFactory<mojo::ViewTreeHostFactory>, |
47 public mojo::ViewTreeHostFactory { | 41 public mojo::InterfaceFactory<mojo::Gpu>, |
| 42 public mojo::ViewTreeHostFactory { |
48 public: | 43 public: |
49 ViewManagerApp(); | 44 MandolineUIServicesApp(); |
50 ~ViewManagerApp() override; | 45 ~MandolineUIServicesApp() override; |
51 | 46 |
52 private: | 47 private: |
53 // ApplicationDelegate: | 48 // ApplicationDelegate: |
54 void Initialize(mojo::ApplicationImpl* app) override; | 49 void Initialize(mojo::ApplicationImpl* app) override; |
55 bool ConfigureIncomingConnection( | 50 bool ConfigureIncomingConnection( |
56 mojo::ApplicationConnection* connection) override; | 51 mojo::ApplicationConnection* connection) override; |
57 | 52 |
58 // ConnectionManagerDelegate: | 53 // ConnectionManagerDelegate: |
59 void OnNoMoreRootConnections() override; | 54 void OnNoMoreRootConnections() override; |
60 ClientConnection* CreateClientConnectionForEmbedAtView( | 55 ClientConnection* CreateClientConnectionForEmbedAtView( |
61 ConnectionManager* connection_manager, | 56 ConnectionManager* connection_manager, |
62 mojo::InterfaceRequest<mojo::ViewTree> tree_request, | 57 mojo::InterfaceRequest<mojo::ViewTree> tree_request, |
63 mojo::ConnectionSpecificId creator_id, | 58 ConnectionSpecificId creator_id, |
64 mojo::URLRequestPtr request, | 59 mojo::URLRequestPtr request, |
65 const ViewId& root_id) override; | 60 const ViewId& root_id) override; |
66 ClientConnection* CreateClientConnectionForEmbedAtView( | 61 ClientConnection* CreateClientConnectionForEmbedAtView( |
67 ConnectionManager* connection_manager, | 62 ConnectionManager* connection_manager, |
68 mojo::InterfaceRequest<mojo::ViewTree> tree_request, | 63 mojo::InterfaceRequest<mojo::ViewTree> tree_request, |
69 mojo::ConnectionSpecificId creator_id, | 64 ConnectionSpecificId creator_id, |
70 const ViewId& root_id, | 65 const ViewId& root_id, |
71 mojo::ViewTreeClientPtr client) override; | 66 mojo::ViewTreeClientPtr client) override; |
72 | 67 |
73 // mojo::InterfaceFactory<mojo::ViewTreeHostFactory>: | 68 // mojo::InterfaceFactory<mojo::ViewTreeHostFactory>: |
74 void Create( | 69 void Create( |
75 mojo::ApplicationConnection* connection, | 70 mojo::ApplicationConnection* connection, |
76 mojo::InterfaceRequest<mojo::ViewTreeHostFactory> request) override; | 71 mojo::InterfaceRequest<mojo::ViewTreeHostFactory> request) override; |
77 | 72 |
78 // mojo::InterfaceFactory<mojo::Gpu> implementation. | 73 // mojo::InterfaceFactory<mojo::Gpu> implementation. |
79 void Create(mojo::ApplicationConnection* connection, | 74 void Create(mojo::ApplicationConnection* connection, |
80 mojo::InterfaceRequest<mojo::Gpu> request) override; | 75 mojo::InterfaceRequest<mojo::Gpu> request) override; |
81 | 76 |
82 // mojo::ViewTreeHostFactory implementation. | 77 // mojo::ViewTreeHostFactory implementation. |
83 void CreateViewTreeHost(mojo::InterfaceRequest<mojo::ViewTreeHost> host, | 78 void CreateViewTreeHost(mojo::InterfaceRequest<mojo::ViewTreeHost> host, |
84 mojo::ViewTreeHostClientPtr host_client, | 79 mojo::ViewTreeHostClientPtr host_client, |
85 mojo::ViewTreeClientPtr tree_client) override; | 80 mojo::ViewTreeClientPtr tree_client) override; |
86 | 81 |
87 mojo::WeakBindingSet<mojo::ViewTreeHostFactory> factory_bindings_; | 82 mojo::WeakBindingSet<mojo::ViewTreeHostFactory> factory_bindings_; |
88 mojo::ApplicationImpl* app_impl_; | 83 mojo::ApplicationImpl* app_impl_; |
89 scoped_ptr<ConnectionManager> connection_manager_; | 84 scoped_ptr<ConnectionManager> connection_manager_; |
90 mojo::TracingImpl tracing_; | 85 mojo::TracingImpl tracing_; |
91 scoped_refptr<gles2::GpuState> gpu_state_; | 86 scoped_refptr<GpuState> gpu_state_; |
92 scoped_ptr<ui::PlatformEventSource> event_source_; | 87 scoped_ptr<ui::PlatformEventSource> event_source_; |
93 bool is_headless_; | 88 bool is_headless_; |
94 | 89 |
95 // Surfaces | 90 // Surfaces |
96 scoped_refptr<surfaces::SurfacesState> surfaces_state_; | 91 scoped_refptr<SurfacesState> surfaces_state_; |
97 | 92 |
98 DISALLOW_COPY_AND_ASSIGN(ViewManagerApp); | 93 DISALLOW_COPY_AND_ASSIGN(MandolineUIServicesApp); |
99 }; | 94 }; |
100 | 95 |
101 } // namespace view_manager | 96 } // namespace mus |
102 | 97 |
103 #endif // COMPONENTS_MUS_VIEW_MANAGER_APP_H_ | 98 #endif // COMPONENTS_MUS_VIEW_MANAGER_APP_H_ |
OLD | NEW |