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