OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 SERVICES_GFX_COMPOSITOR_COMPOSITOR_APP_H_ | 5 #ifndef SERVICES_GFX_COMPOSITOR_COMPOSITOR_APP_H_ |
6 #define SERVICES_GFX_COMPOSITOR_COMPOSITOR_APP_H_ | 6 #define SERVICES_GFX_COMPOSITOR_COMPOSITOR_APP_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "mojo/common/strong_binding_set.h" | 12 #include "mojo/common/strong_binding_set.h" |
13 #include "mojo/common/tracing_impl.h" | 13 #include "mojo/common/tracing_impl.h" |
14 #include "mojo/public/cpp/application/application_delegate.h" | 14 #include "mojo/public/cpp/application/application_delegate.h" |
15 #include "mojo/public/cpp/application/interface_factory.h" | |
16 #include "mojo/services/gfx/composition/interfaces/compositor.mojom.h" | 15 #include "mojo/services/gfx/composition/interfaces/compositor.mojom.h" |
17 #include "services/gfx/compositor/compositor_engine.h" | 16 #include "services/gfx/compositor/compositor_engine.h" |
18 | 17 |
19 namespace compositor { | 18 namespace compositor { |
20 | 19 |
21 // Compositor application entry point. | 20 // Compositor application entry point. |
22 class CompositorApp | 21 class CompositorApp : public mojo::ApplicationDelegate { |
23 : public mojo::ApplicationDelegate, | |
24 public mojo::InterfaceFactory<mojo::gfx::composition::Compositor> { | |
25 public: | 22 public: |
26 CompositorApp(); | 23 CompositorApp(); |
27 ~CompositorApp() override; | 24 ~CompositorApp() override; |
28 | 25 |
29 private: | 26 private: |
30 // |ApplicationDelegate|: | 27 // |ApplicationDelegate|: |
31 void Initialize(mojo::ApplicationImpl* app_impl) override; | 28 void Initialize(mojo::ApplicationImpl* app_impl) override; |
32 bool ConfigureIncomingConnection( | 29 bool ConfigureIncomingConnection( |
33 mojo::ApplicationConnection* connection) override; | 30 mojo::ApplicationConnection* connection) override; |
34 | 31 |
35 // |InterfaceFactory<Compositor>|: | |
36 void Create(const mojo::ConnectionContext& connection_context, | |
37 mojo::InterfaceRequest<mojo::gfx::composition::Compositor> | |
38 request) override; | |
39 | |
40 mojo::ApplicationImpl* app_impl_; | 32 mojo::ApplicationImpl* app_impl_; |
41 mojo::TracingImpl tracing_; | 33 mojo::TracingImpl tracing_; |
42 | 34 |
43 mojo::StrongBindingSet<mojo::gfx::composition::Compositor> | 35 mojo::StrongBindingSet<mojo::gfx::composition::Compositor> |
44 compositor_bindings_; | 36 compositor_bindings_; |
45 std::unique_ptr<CompositorEngine> engine_; | 37 std::unique_ptr<CompositorEngine> engine_; |
46 | 38 |
47 DISALLOW_COPY_AND_ASSIGN(CompositorApp); | 39 DISALLOW_COPY_AND_ASSIGN(CompositorApp); |
48 }; | 40 }; |
49 | 41 |
50 } // namespace compositor | 42 } // namespace compositor |
51 | 43 |
52 #endif // SERVICES_GFX_COMPOSITOR_COMPOSITOR_APP_H_ | 44 #endif // SERVICES_GFX_COMPOSITOR_COMPOSITOR_APP_H_ |
OLD | NEW |