| 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 #include "components/web_view/web_view_application_delegate.h" | 5 #include "components/web_view/web_view_application_delegate.h" |
| 6 | 6 |
| 7 #include "components/web_view/web_view_impl.h" | 7 #include "components/web_view/web_view_impl.h" |
| 8 #include "mojo/application/public/cpp/application_connection.h" | 8 #include "mojo/application/public/cpp/application_connection.h" |
| 9 | 9 |
| 10 namespace web_view { | 10 namespace web_view { |
| 11 | 11 |
| 12 WebViewApplicationDelegate::WebViewApplicationDelegate() : app_(nullptr) {} | 12 WebViewApplicationDelegate::WebViewApplicationDelegate() : app_(nullptr) {} |
| 13 WebViewApplicationDelegate::~WebViewApplicationDelegate() {} | 13 WebViewApplicationDelegate::~WebViewApplicationDelegate() {} |
| 14 | 14 |
| 15 void WebViewApplicationDelegate::Initialize(mojo::ApplicationImpl* app) { | 15 void WebViewApplicationDelegate::Initialize(mojo::ApplicationImpl* app) { |
| 16 app_ = app; | 16 app_ = app; |
| 17 tracing_.Initialize(app); |
| 17 } | 18 } |
| 18 | 19 |
| 19 bool WebViewApplicationDelegate::ConfigureIncomingConnection( | 20 bool WebViewApplicationDelegate::ConfigureIncomingConnection( |
| 20 mojo::ApplicationConnection* connection) { | 21 mojo::ApplicationConnection* connection) { |
| 21 connection->AddService<mojom::WebViewFactory>(this); | 22 connection->AddService<mojom::WebViewFactory>(this); |
| 22 return true; | 23 return true; |
| 23 } | 24 } |
| 24 | 25 |
| 25 void WebViewApplicationDelegate::CreateWebView( | 26 void WebViewApplicationDelegate::CreateWebView( |
| 26 mojom::WebViewClientPtr client, | 27 mojom::WebViewClientPtr client, |
| 27 mojo::InterfaceRequest<mojom::WebView> web_view) { | 28 mojo::InterfaceRequest<mojom::WebView> web_view) { |
| 28 new WebViewImpl(app_, client.Pass(), web_view.Pass()); | 29 new WebViewImpl(app_, client.Pass(), web_view.Pass()); |
| 29 } | 30 } |
| 30 | 31 |
| 31 void WebViewApplicationDelegate::Create( | 32 void WebViewApplicationDelegate::Create( |
| 32 mojo::ApplicationConnection* connection, | 33 mojo::ApplicationConnection* connection, |
| 33 mojo::InterfaceRequest<mojom::WebViewFactory> request) { | 34 mojo::InterfaceRequest<mojom::WebViewFactory> request) { |
| 34 factory_bindings_.AddBinding(this, request.Pass()); | 35 factory_bindings_.AddBinding(this, request.Pass()); |
| 35 } | 36 } |
| 36 | 37 |
| 37 } // namespace web_view | 38 } // namespace web_view |
| OLD | NEW |