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_manager_root.mojom.h" | 14 #include "components/view_manager/public/interfaces/view_manager_root.mojom.h" |
16 #include "components/view_manager/public/interfaces/view_tree.mojom.h" | 15 #include "components/view_manager/public/interfaces/view_tree.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 | 20 |
23 namespace gles2 { | 21 namespace gles2 { |
24 class GpuState; | 22 class GpuState; |
25 } | 23 } |
26 | 24 |
27 namespace mojo { | 25 namespace mojo { |
28 class ApplicationImpl; | 26 class ApplicationImpl; |
29 } | 27 } |
30 | 28 |
31 namespace surfaces { | 29 namespace surfaces { |
32 class DisplayImpl; | |
33 class SurfacesImpl; | |
34 class SurfacesScheduler; | 30 class SurfacesScheduler; |
35 class SurfacesState; | 31 class SurfacesState; |
36 } | 32 } |
37 | 33 |
38 namespace ui { | 34 namespace ui { |
39 class PlatformEventSource; | 35 class PlatformEventSource; |
40 } | 36 } |
41 | 37 |
42 namespace view_manager { | 38 namespace view_manager { |
43 | 39 |
44 class ConnectionManager; | 40 class ConnectionManager; |
45 | 41 |
46 class ViewManagerApp : public mojo::ApplicationDelegate, | 42 class ViewManagerApp : public mojo::ApplicationDelegate, |
47 public ConnectionManagerDelegate, | 43 public ConnectionManagerDelegate, |
48 public mojo::InterfaceFactory<mojo::Surface>, | |
49 public mojo::InterfaceFactory<mojo::ViewManagerRoot>, | 44 public mojo::InterfaceFactory<mojo::ViewManagerRoot>, |
50 public mojo::InterfaceFactory<mojo::Gpu>, | 45 public mojo::InterfaceFactory<mojo::Gpu> { |
51 public surfaces::SurfacesDelegate { | |
52 public: | 46 public: |
53 ViewManagerApp(); | 47 ViewManagerApp(); |
54 ~ViewManagerApp() override; | 48 ~ViewManagerApp() override; |
55 | 49 |
56 private: | 50 private: |
57 // ApplicationDelegate: | 51 // ApplicationDelegate: |
58 void Initialize(mojo::ApplicationImpl* app) override; | 52 void Initialize(mojo::ApplicationImpl* app) override; |
59 bool ConfigureIncomingConnection( | 53 bool ConfigureIncomingConnection( |
60 mojo::ApplicationConnection* connection) override; | 54 mojo::ApplicationConnection* connection) override; |
61 | 55 |
(...skipping 13 matching lines...) Expand all Loading... |
75 mojo::ViewTreeClientPtr client) override; | 69 mojo::ViewTreeClientPtr client) override; |
76 | 70 |
77 // mojo::InterfaceFactory<mojo::ViewManagerRoot>: | 71 // mojo::InterfaceFactory<mojo::ViewManagerRoot>: |
78 void Create(mojo::ApplicationConnection* connection, | 72 void Create(mojo::ApplicationConnection* connection, |
79 mojo::InterfaceRequest<mojo::ViewManagerRoot> request) override; | 73 mojo::InterfaceRequest<mojo::ViewManagerRoot> request) override; |
80 | 74 |
81 // mojo::InterfaceFactory<mojo::Gpu> implementation. | 75 // mojo::InterfaceFactory<mojo::Gpu> implementation. |
82 void Create(mojo::ApplicationConnection* connection, | 76 void Create(mojo::ApplicationConnection* connection, |
83 mojo::InterfaceRequest<mojo::Gpu> request) override; | 77 mojo::InterfaceRequest<mojo::Gpu> request) override; |
84 | 78 |
85 // InterfaceFactory<Surface> implementation. | |
86 void Create(mojo::ApplicationConnection* connection, | |
87 mojo::InterfaceRequest<mojo::Surface> request) override; | |
88 | |
89 // SurfacesDelegat implementation. | |
90 void OnSurfaceConnectionClosed(surfaces::SurfacesImpl* surface) override; | |
91 | |
92 // ViewManager | 79 // ViewManager |
93 mojo::ApplicationImpl* app_impl_; | 80 mojo::ApplicationImpl* app_impl_; |
94 scoped_ptr<ConnectionManager> connection_manager_; | 81 scoped_ptr<ConnectionManager> connection_manager_; |
95 mojo::TracingImpl tracing_; | 82 mojo::TracingImpl tracing_; |
96 scoped_refptr<gles2::GpuState> gpu_state_; | 83 scoped_refptr<gles2::GpuState> gpu_state_; |
97 scoped_ptr<ui::PlatformEventSource> event_source_; | 84 scoped_ptr<ui::PlatformEventSource> event_source_; |
98 bool is_headless_; | 85 bool is_headless_; |
99 | 86 |
100 // Surfaces | 87 // Surfaces |
101 std::set<surfaces::SurfacesImpl*> surfaces_; | |
102 scoped_refptr<surfaces::SurfacesState> surfaces_state_; | 88 scoped_refptr<surfaces::SurfacesState> surfaces_state_; |
103 | 89 |
104 DISALLOW_COPY_AND_ASSIGN(ViewManagerApp); | 90 DISALLOW_COPY_AND_ASSIGN(ViewManagerApp); |
105 }; | 91 }; |
106 | 92 |
107 } // namespace view_manager | 93 } // namespace view_manager |
108 | 94 |
109 #endif // COMPONENTS_VIEW_MANAGER_VIEW_MANAGER_APP_H_ | 95 #endif // COMPONENTS_VIEW_MANAGER_VIEW_MANAGER_APP_H_ |
OLD | NEW |