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