OLD | NEW |
| (Empty) |
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. | |
4 | |
5 #ifndef SERVICES_KIOSK_WM_MERGED_SERVICE_PROVIDER_H_ | |
6 #define SERVICES_KIOSK_WM_MERGED_SERVICE_PROVIDER_H_ | |
7 | |
8 #include "base/memory/scoped_ptr.h" | |
9 #include "mojo/public/cpp/application/interface_factory.h" | |
10 #include "mojo/public/cpp/bindings/binding.h" | |
11 #include "mojo/public/interfaces/application/service_provider.mojom.h" | |
12 #include "mojo/services/navigation/interfaces/navigation.mojom.h" | |
13 | |
14 namespace kiosk_wm { | |
15 | |
16 // Used to wrap the second incoming WindowManager Embed() "exposed_services" | |
17 // parameter with a new ServiceProvider that adds the KioskWM's | |
18 // NavigatorHost service. | |
19 class MergedServiceProvider : public mojo::ServiceProvider { | |
20 public: | |
21 MergedServiceProvider(mojo::ServiceProviderPtr exposed_services, | |
22 mojo::InterfaceFactory<mojo::NavigatorHost>* factory); | |
23 ~MergedServiceProvider() override; | |
24 | |
25 mojo::ServiceProviderPtr GetServiceProviderPtr(); | |
26 | |
27 private: | |
28 // mojo::ServiceProvider: | |
29 void ConnectToService(const mojo::String& interface_name, | |
30 mojo::ScopedMessagePipeHandle pipe) override; | |
31 | |
32 mojo::ServiceProviderPtr exposed_services_; | |
33 mojo::InterfaceFactory<mojo::NavigatorHost>* factory_; | |
34 scoped_ptr<mojo::Binding<ServiceProvider>> binding_; | |
35 | |
36 DISALLOW_COPY_AND_ASSIGN(MergedServiceProvider); | |
37 }; | |
38 | |
39 } // namespace kiosk_wm | |
40 | |
41 #endif // SERVICES_KIOSK_WM_MERGED_SERVICE_PROVIDER_H_ | |
OLD | NEW |