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 COMPONENTS_CORE_SERVICES_APPLICATION_DELEGATE_H_ |
| 6 #define COMPONENTS_CORE_SERVICES_APPLICATION_DELEGATE_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "mojo/common/weak_binding_set.h" |
| 10 #include "third_party/mojo/src/mojo/public/cpp/application/application_delegate.
h" |
| 11 #include "third_party/mojo/src/mojo/public/cpp/application/interface_factory_imp
l.h" |
| 12 #include "third_party/mojo/src/mojo/public/interfaces/application/service_provid
er.mojom.h" |
| 13 |
| 14 namespace core_services { |
| 15 |
| 16 // The CoreServices application is a singleton ServiceProvider. There is one |
| 17 // instance of the CoreServices ServiceProvider. |
| 18 class CoreServicesApplicationDelegate |
| 19 : public mojo::ApplicationDelegate, |
| 20 public mojo::InterfaceFactory<mojo::ServiceProvider>, |
| 21 public mojo::ServiceProvider { |
| 22 public: |
| 23 CoreServicesApplicationDelegate(); |
| 24 ~CoreServicesApplicationDelegate() override; |
| 25 |
| 26 private: |
| 27 // Overridden from mojo::ApplicationDelegate: |
| 28 bool ConfigureIncomingConnection( |
| 29 mojo::ApplicationConnection* connection) override; |
| 30 |
| 31 // Overridden from mojo::InterfaceFactory<ServiceProvider>: |
| 32 void Create(mojo::ApplicationConnection* connection, |
| 33 mojo::InterfaceRequest<ServiceProvider> request) override; |
| 34 |
| 35 // Overridden from ServiceProvider: |
| 36 void ConnectToService(const mojo::String& service_name, |
| 37 mojo::ScopedMessagePipeHandle client_handle) override; |
| 38 |
| 39 // Bindings for all of our connections. |
| 40 mojo::WeakBindingSet<ServiceProvider> provider_bindings_; |
| 41 |
| 42 DISALLOW_COPY_AND_ASSIGN(CoreServicesApplicationDelegate); |
| 43 }; |
| 44 |
| 45 } // namespace core_services |
| 46 |
| 47 #endif // COMPONENTS_CORE_SERVICES_APPLICATION_DELEGATE_H_ |
OLD | NEW |