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.
5 #ifndef CONTENT_BROWSER_FRAME_HOST_FRAME_MOJO_SHELL_H_
6 #define CONTENT_BROWSER_FRAME_HOST_FRAME_MOJO_SHELL_H_
8 #include "base/macros.h"
9 #include "mojo/application/public/interfaces/shell.mojom.h"
10 #include "mojo/common/weak_binding_set.h"
11 #include "third_party/mojo/src/mojo/public/cpp/bindings/interface_request.h"
15 class RenderFrameHost
;
17 // This provides the |mojo::Shell| service interface to each frame's
18 // ServiceRegistry, giving frames the ability to connect to Mojo applications.
19 class FrameMojoShell
: public mojo::Shell
{
21 explicit FrameMojoShell(RenderFrameHost
* frame_host
);
22 ~FrameMojoShell() override
;
24 void BindRequest(mojo::InterfaceRequest
<mojo::Shell
> shell_request
);
28 void ConnectToApplication(
29 mojo::URLRequestPtr application_url
,
30 mojo::InterfaceRequest
<mojo::ServiceProvider
> services
,
31 mojo::ServiceProviderPtr exposed_services
) override
;
32 void QuitApplication() override
;
34 RenderFrameHost
* frame_host_
;
35 mojo::WeakBindingSet
<mojo::Shell
> bindings_
;
37 DISALLOW_COPY_AND_ASSIGN(FrameMojoShell
);
40 } // namespace content
42 #endif // CONTENT_BROWSER_FRAME_HOST_FRAME_MOJO_SHELL_H_