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
3 // found in the LICENSE file.
5 #ifndef COMPONENTS_VIEW_MANAGER_SURFACES_DISPLAY_FACTORY_IMPL_H_
6 #define COMPONENTS_VIEW_MANAGER_SURFACES_DISPLAY_FACTORY_IMPL_H_
8 #include "components/view_manager/public/interfaces/display.mojom.h"
9 #include "components/view_manager/surfaces/display_impl.h"
10 #include "third_party/mojo/src/mojo/public/cpp/bindings/strong_binding.h"
17 class SurfacesScheduler
;
18 class SurfacesServiceApplication
;
20 class DisplayFactoryImpl
: public mojo::DisplayFactory
{
22 DisplayFactoryImpl(SurfacesServiceApplication
* application
,
23 cc::SurfaceManager
* manager
,
24 uint32_t id_namespace
,
25 SurfacesScheduler
* scheduler
,
26 mojo::InterfaceRequest
<mojo::DisplayFactory
> request
);
27 ~DisplayFactoryImpl() override
;
30 // mojo::DisplayFactory implementation.
31 void Create(mojo::ContextProviderPtr context_provider
,
32 mojo::ResourceReturnerPtr returner
,
33 mojo::InterfaceRequest
<mojo::Display
> display_request
) override
;
35 // We use one ID namespace for all DisplayImpls since the ID is used only by
36 // cc and not exposed through mojom.
37 uint32_t id_namespace_
;
38 uint32_t next_local_id_
;
39 SurfacesServiceApplication
* application_
;
40 SurfacesScheduler
* scheduler_
;
41 cc::SurfaceManager
* manager_
;
42 mojo::StrongBinding
<mojo::DisplayFactory
> binding_
;
45 } // namespace surfaces
47 #endif // COMPONENTS_VIEW_MANAGER_SURFACES_DISPLAY_FACTORY_IMPL_H_