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