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.
5 #ifndef COMPONENTS_SURFACES_SURFACES_SERVICE_APPLICATION_H_
6 #define COMPONENTS_SURFACES_SURFACES_SERVICE_APPLICATION_H_
8 #include "base/macros.h"
9 #include "cc/surfaces/surface_manager.h"
10 #include "components/surfaces/public/interfaces/display.mojom.h"
11 #include "components/surfaces/public/interfaces/surfaces.mojom.h"
12 #include "mojo/common/tracing_impl.h"
13 #include "third_party/mojo/src/mojo/public/cpp/application/application_delegate.h"
14 #include "third_party/mojo/src/mojo/public/cpp/application/interface_factory.h"
17 class ApplicationConnection
;
21 class SurfacesScheduler
;
23 class SurfacesServiceApplication
24 : public mojo::ApplicationDelegate
,
25 public mojo::InterfaceFactory
<mojo::DisplayFactory
>,
26 public mojo::InterfaceFactory
<mojo::Surface
> {
28 SurfacesServiceApplication();
29 ~SurfacesServiceApplication() override
;
31 // ApplicationDelegate implementation.
32 void Initialize(mojo::ApplicationImpl
* app
) override
;
33 bool ConfigureIncomingConnection(
34 mojo::ApplicationConnection
* connection
) override
;
36 // InterfaceFactory<DisplayFactory> implementation.
37 void Create(mojo::ApplicationConnection
* connection
,
38 mojo::InterfaceRequest
<mojo::DisplayFactory
> request
) override
;
40 // InterfaceFactory<Surface> implementation.
41 void Create(mojo::ApplicationConnection
* connection
,
42 mojo::InterfaceRequest
<mojo::Surface
> request
) override
;
45 cc::SurfaceManager manager_
;
46 uint32_t next_id_namespace_
;
47 scoped_ptr
<SurfacesScheduler
> scheduler_
;
48 mojo::TracingImpl tracing_
;
50 DISALLOW_COPY_AND_ASSIGN(SurfacesServiceApplication
);
53 } // namespace surfaces
55 #endif // COMPONENTS_SURFACES_SURFACES_SERVICE_APPLICATION_H_