| 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 CONTENT_BROWSER_FRAME_HOST_FRAME_MOJO_SHELL_H_ | 5 #ifndef CONTENT_BROWSER_FRAME_HOST_FRAME_MOJO_SHELL_H_ |
| 6 #define CONTENT_BROWSER_FRAME_HOST_FRAME_MOJO_SHELL_H_ | 6 #define CONTENT_BROWSER_FRAME_HOST_FRAME_MOJO_SHELL_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "mojo/public/cpp/bindings/binding_set.h" | 11 #include "mojo/public/cpp/bindings/binding_set.h" |
| 12 #include "mojo/public/cpp/bindings/interface_request.h" | 12 #include "mojo/public/cpp/bindings/interface_request.h" |
| 13 #include "services/shell/public/interfaces/connector.mojom.h" | 13 #include "services/shell/public/interfaces/connector.mojom.h" |
| 14 | 14 |
| 15 namespace content { | 15 namespace content { |
| 16 | 16 |
| 17 class RenderFrameHost; | 17 class RenderFrameHost; |
| 18 class ServiceRegistryImpl; | 18 class ServiceRegistryImpl; |
| 19 | 19 |
| 20 // This provides the |mojo::shell::mojom::Shell| service interface to each | 20 // This provides the |shell::mojom::Shell| service interface to each |
| 21 // frame's ServiceRegistry, giving frames the ability to connect to Mojo | 21 // frame's ServiceRegistry, giving frames the ability to connect to Mojo |
| 22 // applications. | 22 // applications. |
| 23 class FrameMojoShell : public mojo::shell::mojom::Connector { | 23 class FrameMojoShell : public shell::mojom::Connector { |
| 24 public: | 24 public: |
| 25 explicit FrameMojoShell(RenderFrameHost* frame_host); | 25 explicit FrameMojoShell(RenderFrameHost* frame_host); |
| 26 ~FrameMojoShell() override; | 26 ~FrameMojoShell() override; |
| 27 | 27 |
| 28 void BindRequest(mojo::shell::mojom::ConnectorRequest request); | 28 void BindRequest(shell::mojom::ConnectorRequest request); |
| 29 | 29 |
| 30 private: | 30 private: |
| 31 // mojo::Connector: | 31 // shell::Connector: |
| 32 void Connect( | 32 void Connect( |
| 33 mojo::shell::mojom::IdentityPtr target, | 33 shell::mojom::IdentityPtr target, |
| 34 mojo::shell::mojom::InterfaceProviderRequest services, | 34 shell::mojom::InterfaceProviderRequest services, |
| 35 mojo::shell::mojom::InterfaceProviderPtr exposed_services, | 35 shell::mojom::InterfaceProviderPtr exposed_services, |
| 36 mojo::shell::mojom::ClientProcessConnectionPtr client_process_connection, | 36 shell::mojom::ClientProcessConnectionPtr client_process_connection, |
| 37 const mojo::shell::mojom::Connector::ConnectCallback& callback) override; | 37 const shell::mojom::Connector::ConnectCallback& callback) override; |
| 38 void Clone(mojo::shell::mojom::ConnectorRequest request) override; | 38 void Clone(shell::mojom::ConnectorRequest request) override; |
| 39 | 39 |
| 40 ServiceRegistryImpl* GetServiceRegistry(); | 40 ServiceRegistryImpl* GetServiceRegistry(); |
| 41 | 41 |
| 42 RenderFrameHost* frame_host_; | 42 RenderFrameHost* frame_host_; |
| 43 mojo::BindingSet<mojo::shell::mojom::Connector> connectors_; | 43 mojo::BindingSet<shell::mojom::Connector> connectors_; |
| 44 | 44 |
| 45 // ServiceRegistry providing browser services to connected applications. | 45 // ServiceRegistry providing browser services to connected applications. |
| 46 std::unique_ptr<ServiceRegistryImpl> service_registry_; | 46 std::unique_ptr<ServiceRegistryImpl> service_registry_; |
| 47 mojo::BindingSet<mojo::shell::mojom::InterfaceProvider> | 47 mojo::BindingSet<shell::mojom::InterfaceProvider> service_provider_bindings_; |
| 48 service_provider_bindings_; | |
| 49 | 48 |
| 50 DISALLOW_COPY_AND_ASSIGN(FrameMojoShell); | 49 DISALLOW_COPY_AND_ASSIGN(FrameMojoShell); |
| 51 }; | 50 }; |
| 52 | 51 |
| 53 } // namespace content | 52 } // namespace content |
| 54 | 53 |
| 55 #endif // CONTENT_BROWSER_FRAME_HOST_FRAME_MOJO_SHELL_H_ | 54 #endif // CONTENT_BROWSER_FRAME_HOST_FRAME_MOJO_SHELL_H_ |
| OLD | NEW |