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 COMPONENTS_WEB_VIEW_WEB_VIEW_APPLICATION_DELEGATE_H_
6 #define COMPONENTS_WEB_VIEW_WEB_VIEW_APPLICATION_DELEGATE_H_
8 #include "base/macros.h"
9 #include "components/web_view/public/interfaces/web_view.mojom.h"
10 #include "mojo/application/public/cpp/application_delegate.h"
11 #include "mojo/application/public/cpp/interface_factory.h"
12 #include "mojo/common/weak_binding_set.h"
16 class WebViewApplicationDelegate
17 : public mojo::ApplicationDelegate
,
18 public mojom::WebViewFactory
,
19 public mojo::InterfaceFactory
<mojom::WebViewFactory
> {
21 WebViewApplicationDelegate();
22 ~WebViewApplicationDelegate() override
;
25 // Overridden from mojo::ApplicationDelegate:
26 void Initialize(mojo::ApplicationImpl
* app
) override
;
27 bool ConfigureIncomingConnection(
28 mojo::ApplicationConnection
* connection
) override
;
30 // Overridden from mojom::WebViewFactory:
31 void CreateWebView(mojom::WebViewClientPtr client
,
32 mojo::InterfaceRequest
<mojom::WebView
> web_view
) override
;
34 // Overridden from mojo::InterfaceFactory<mojom::WebView>:
35 void Create(mojo::ApplicationConnection
* connection
,
36 mojo::InterfaceRequest
<mojom::WebViewFactory
> request
) override
;
38 mojo::ApplicationImpl
* app_
;
40 mojo::WeakBindingSet
<WebViewFactory
> factory_bindings_
;
42 DISALLOW_COPY_AND_ASSIGN(WebViewApplicationDelegate
);
45 } // namespace web_view
47 #endif // COMPONENTS_WEB_VIEW_WEB_VIEW_APPLICATION_DELEGATE_H_