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_VIEW_MANAGER_VIEW_MANAGER_APP_H_ | 5 #ifndef COMPONENTS_VIEW_MANAGER_VIEW_MANAGER_APP_H_ |
6 #define COMPONENTS_VIEW_MANAGER_VIEW_MANAGER_APP_H_ | 6 #define COMPONENTS_VIEW_MANAGER_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/view_manager/connection_manager_delegate.h" | 12 #include "components/view_manager/connection_manager_delegate.h" |
13 #include "components/view_manager/public/interfaces/gpu.mojom.h" | 13 #include "components/view_manager/public/interfaces/gpu.mojom.h" |
14 #include "components/view_manager/public/interfaces/surfaces.mojom.h" | |
15 #include "components/view_manager/public/interfaces/view_tree.mojom.h" | 14 #include "components/view_manager/public/interfaces/view_tree.mojom.h" |
16 #include "components/view_manager/public/interfaces/view_tree_host.mojom.h" | 15 #include "components/view_manager/public/interfaces/view_tree_host.mojom.h" |
17 #include "components/view_manager/surfaces/surfaces_delegate.h" | |
18 #include "mojo/application/public/cpp/app_lifetime_helper.h" | 16 #include "mojo/application/public/cpp/app_lifetime_helper.h" |
19 #include "mojo/application/public/cpp/application_delegate.h" | 17 #include "mojo/application/public/cpp/application_delegate.h" |
20 #include "mojo/application/public/cpp/interface_factory.h" | 18 #include "mojo/application/public/cpp/interface_factory.h" |
21 #include "mojo/common/tracing_impl.h" | 19 #include "mojo/common/tracing_impl.h" |
22 #include "mojo/common/weak_binding_set.h" | 20 #include "mojo/common/weak_binding_set.h" |
23 | 21 |
24 namespace gles2 { | 22 namespace gles2 { |
25 class GpuState; | 23 class GpuState; |
26 } | 24 } |
27 | 25 |
28 namespace mojo { | 26 namespace mojo { |
29 class ApplicationImpl; | 27 class ApplicationImpl; |
30 } | 28 } |
31 | 29 |
32 namespace surfaces { | 30 namespace surfaces { |
33 class DisplayImpl; | |
34 class SurfacesImpl; | |
35 class SurfacesScheduler; | 31 class SurfacesScheduler; |
36 class SurfacesState; | 32 class SurfacesState; |
37 } | 33 } |
38 | 34 |
39 namespace ui { | 35 namespace ui { |
40 class PlatformEventSource; | 36 class PlatformEventSource; |
41 } | 37 } |
42 | 38 |
43 namespace view_manager { | 39 namespace view_manager { |
44 | 40 |
45 class ConnectionManager; | 41 class ConnectionManager; |
46 | 42 |
47 class ViewManagerApp : public mojo::ApplicationDelegate, | 43 class ViewManagerApp : public mojo::ApplicationDelegate, |
48 public ConnectionManagerDelegate, | 44 public ConnectionManagerDelegate, |
49 public mojo::InterfaceFactory<mojo::Surface>, | |
50 public mojo::InterfaceFactory<mojo::ViewTreeHostFactory>, | 45 public mojo::InterfaceFactory<mojo::ViewTreeHostFactory>, |
51 public mojo::InterfaceFactory<mojo::Gpu>, | 46 public mojo::InterfaceFactory<mojo::Gpu>, |
52 public surfaces::SurfacesDelegate, | |
53 public mojo::ViewTreeHostFactory { | 47 public mojo::ViewTreeHostFactory { |
54 public: | 48 public: |
55 ViewManagerApp(); | 49 ViewManagerApp(); |
56 ~ViewManagerApp() override; | 50 ~ViewManagerApp() override; |
57 | 51 |
58 private: | 52 private: |
59 // ApplicationDelegate: | 53 // ApplicationDelegate: |
60 void Initialize(mojo::ApplicationImpl* app) override; | 54 void Initialize(mojo::ApplicationImpl* app) override; |
61 bool ConfigureIncomingConnection( | 55 bool ConfigureIncomingConnection( |
62 mojo::ApplicationConnection* connection) override; | 56 mojo::ApplicationConnection* connection) override; |
(...skipping 15 matching lines...) Expand all Loading... |
78 | 72 |
79 // mojo::InterfaceFactory<mojo::ViewTreeHostFactory>: | 73 // mojo::InterfaceFactory<mojo::ViewTreeHostFactory>: |
80 void Create( | 74 void Create( |
81 mojo::ApplicationConnection* connection, | 75 mojo::ApplicationConnection* connection, |
82 mojo::InterfaceRequest<mojo::ViewTreeHostFactory> request) override; | 76 mojo::InterfaceRequest<mojo::ViewTreeHostFactory> request) override; |
83 | 77 |
84 // mojo::InterfaceFactory<mojo::Gpu> implementation. | 78 // mojo::InterfaceFactory<mojo::Gpu> implementation. |
85 void Create(mojo::ApplicationConnection* connection, | 79 void Create(mojo::ApplicationConnection* connection, |
86 mojo::InterfaceRequest<mojo::Gpu> request) override; | 80 mojo::InterfaceRequest<mojo::Gpu> request) override; |
87 | 81 |
88 // InterfaceFactory<Surface> implementation. | |
89 void Create(mojo::ApplicationConnection* connection, | |
90 mojo::InterfaceRequest<mojo::Surface> request) override; | |
91 | |
92 // SurfacesDelegat implementation. | |
93 void OnSurfaceConnectionClosed(surfaces::SurfacesImpl* surface) override; | |
94 | |
95 // mojo::ViewTreeHostFactory implementation. | 82 // mojo::ViewTreeHostFactory implementation. |
96 void CreateViewTreeHost(mojo::InterfaceRequest<mojo::ViewTreeHost> host, | 83 void CreateViewTreeHost(mojo::InterfaceRequest<mojo::ViewTreeHost> host, |
97 mojo::ViewTreeHostClientPtr host_client, | 84 mojo::ViewTreeHostClientPtr host_client, |
98 mojo::ViewTreeClientPtr tree_client) override; | 85 mojo::ViewTreeClientPtr tree_client) override; |
99 | 86 |
100 mojo::WeakBindingSet<mojo::ViewTreeHostFactory> factory_bindings_; | 87 mojo::WeakBindingSet<mojo::ViewTreeHostFactory> factory_bindings_; |
101 mojo::ApplicationImpl* app_impl_; | 88 mojo::ApplicationImpl* app_impl_; |
102 scoped_ptr<ConnectionManager> connection_manager_; | 89 scoped_ptr<ConnectionManager> connection_manager_; |
103 mojo::TracingImpl tracing_; | 90 mojo::TracingImpl tracing_; |
104 scoped_refptr<gles2::GpuState> gpu_state_; | 91 scoped_refptr<gles2::GpuState> gpu_state_; |
105 scoped_ptr<ui::PlatformEventSource> event_source_; | 92 scoped_ptr<ui::PlatformEventSource> event_source_; |
106 bool is_headless_; | 93 bool is_headless_; |
107 | 94 |
108 // Surfaces | 95 // Surfaces |
109 std::set<surfaces::SurfacesImpl*> surfaces_; | |
110 scoped_refptr<surfaces::SurfacesState> surfaces_state_; | 96 scoped_refptr<surfaces::SurfacesState> surfaces_state_; |
111 | 97 |
112 DISALLOW_COPY_AND_ASSIGN(ViewManagerApp); | 98 DISALLOW_COPY_AND_ASSIGN(ViewManagerApp); |
113 }; | 99 }; |
114 | 100 |
115 } // namespace view_manager | 101 } // namespace view_manager |
116 | 102 |
117 #endif // COMPONENTS_VIEW_MANAGER_VIEW_MANAGER_APP_H_ | 103 #endif // COMPONENTS_VIEW_MANAGER_VIEW_MANAGER_APP_H_ |
OLD | NEW |