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_VIEW_MANAGER_SURFACES_SURFACES_SERVICE_APPLICATION_H_ | |
6 #define COMPONENTS_VIEW_MANAGER_SURFACES_SURFACES_SERVICE_APPLICATION_H_ | |
7 | |
8 #include <set> | |
9 | |
10 #include "base/macros.h" | |
11 #include "cc/surfaces/surface_manager.h" | |
12 #include "components/view_manager/public/interfaces/display.mojom.h" | |
13 #include "components/view_manager/public/interfaces/surfaces.mojom.h" | |
14 #include "components/view_manager/surfaces/display_delegate.h" | |
15 #include "components/view_manager/surfaces/surfaces_delegate.h" | |
16 #include "components/view_manager/surfaces/surfaces_state.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 | |
21 namespace mojo { | |
22 class ApplicationConnection; | |
23 } | |
24 | |
25 namespace surfaces { | |
26 class DisplayImpl; | |
27 class SurfacesImpl; | |
28 | |
29 class SurfacesServiceApplication | |
30 : public mojo::ApplicationDelegate, | |
31 public mojo::InterfaceFactory<mojo::DisplayFactory>, | |
32 public mojo::InterfaceFactory<mojo::Surface>, | |
33 public DisplayDelegate, | |
34 public SurfacesDelegate { | |
35 public: | |
36 SurfacesServiceApplication(); | |
37 ~SurfacesServiceApplication() override; | |
38 | |
39 // ApplicationDelegate implementation. | |
40 void Initialize(mojo::ApplicationImpl* app) override; | |
41 bool ConfigureIncomingConnection( | |
42 mojo::ApplicationConnection* connection) override; | |
43 | |
44 // InterfaceFactory<DisplayFactory> implementation. | |
45 void Create(mojo::ApplicationConnection* connection, | |
46 mojo::InterfaceRequest<mojo::DisplayFactory> request) override; | |
47 | |
48 // InterfaceFactory<Surface> implementation. | |
49 void Create(mojo::ApplicationConnection* connection, | |
50 mojo::InterfaceRequest<mojo::Surface> request) override; | |
51 | |
52 private: | |
53 mojo::TracingImpl tracing_; | |
54 | |
55 // DisplayDelegate implementation. | |
56 void OnDisplayCreated(DisplayImpl* display) override; | |
57 void OnDisplayConnectionClosed(DisplayImpl* display) override; | |
58 | |
59 // SurfacesDelegate implementation. | |
60 void OnSurfaceConnectionClosed(SurfacesImpl* surface) override; | |
61 | |
62 scoped_refptr<SurfacesState> surfaces_state_; | |
63 | |
64 std::set<DisplayImpl*> displays_; | |
65 std::set<SurfacesImpl*> surfaces_; | |
66 | |
67 DISALLOW_COPY_AND_ASSIGN(SurfacesServiceApplication); | |
68 }; | |
69 | |
70 } // namespace surfaces | |
71 | |
72 #endif // COMPONENTS_VIEW_MANAGER_SURFACES_SURFACES_SERVICE_APPLICATION_H_ | |
OLD | NEW |