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