| 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 COMPONENTS_WEB_VIEW_WEB_VIEW_APPLICATION_DELEGATE_H_ | |
| 6 #define COMPONENTS_WEB_VIEW_WEB_VIEW_APPLICATION_DELEGATE_H_ | |
| 7 | |
| 8 #include "base/macros.h" | |
| 9 #include "components/web_view/public/interfaces/web_view.mojom.h" | |
| 10 #include "mojo/common/weak_binding_set.h" | |
| 11 #include "mojo/services/tracing/public/cpp/tracing_impl.h" | |
| 12 #include "mojo/shell/public/cpp/interface_factory.h" | |
| 13 #include "mojo/shell/public/cpp/shell_client.h" | |
| 14 | |
| 15 namespace web_view { | |
| 16 | |
| 17 class WebViewApplicationDelegate | |
| 18 : public mojo::ShellClient, | |
| 19 public mojom::WebViewFactory, | |
| 20 public mojo::InterfaceFactory<mojom::WebViewFactory> { | |
| 21 public: | |
| 22 WebViewApplicationDelegate(); | |
| 23 ~WebViewApplicationDelegate() override; | |
| 24 | |
| 25 private: | |
| 26 // Overridden from mojo::ShellClient: | |
| 27 void Initialize(mojo::Shell* shell, const std::string& url, | |
| 28 uint32_t id) override; | |
| 29 bool AcceptConnection(mojo::Connection* connection) override; | |
| 30 | |
| 31 // Overridden from mojom::WebViewFactory: | |
| 32 void CreateWebView(mojom::WebViewClientPtr client, | |
| 33 mojo::InterfaceRequest<mojom::WebView> web_view) override; | |
| 34 | |
| 35 // Overridden from mojo::InterfaceFactory<mojom::WebView>: | |
| 36 void Create(mojo::Connection* connection, | |
| 37 mojo::InterfaceRequest<mojom::WebViewFactory> request) override; | |
| 38 | |
| 39 mojo::Shell* shell_; | |
| 40 mojo::TracingImpl tracing_; | |
| 41 | |
| 42 mojo::WeakBindingSet<WebViewFactory> factory_bindings_; | |
| 43 | |
| 44 DISALLOW_COPY_AND_ASSIGN(WebViewApplicationDelegate); | |
| 45 }; | |
| 46 | |
| 47 } // namespace web_view | |
| 48 | |
| 49 #endif // COMPONENTS_WEB_VIEW_WEB_VIEW_APPLICATION_DELEGATE_H_ | |
| OLD | NEW |