| 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/html_viewer/layout_test_content_handler_impl.h" | 5 #include "components/html_viewer/layout_test_content_handler_impl.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 } | 42 } |
| 43 | 43 |
| 44 test_runner::WebTestInterfaces* test_interfaces_; | 44 test_runner::WebTestInterfaces* test_interfaces_; |
| 45 | 45 |
| 46 DISALLOW_COPY_AND_ASSIGN(TestHTMLFrame); | 46 DISALLOW_COPY_AND_ASSIGN(TestHTMLFrame); |
| 47 }; | 47 }; |
| 48 | 48 |
| 49 LayoutTestContentHandlerImpl::LayoutTestContentHandlerImpl( | 49 LayoutTestContentHandlerImpl::LayoutTestContentHandlerImpl( |
| 50 GlobalState* global_state, | 50 GlobalState* global_state, |
| 51 mojo::ApplicationImpl* app, | 51 mojo::ApplicationImpl* app, |
| 52 mojo::InterfaceRequest<mojo::ContentHandler> request, | 52 mojo::InterfaceRequest<mojo::shell::mojom::ContentHandler> request, |
| 53 test_runner::WebTestInterfaces* test_interfaces, | 53 test_runner::WebTestInterfaces* test_interfaces, |
| 54 WebTestDelegateImpl* test_delegate) | 54 WebTestDelegateImpl* test_delegate) |
| 55 : ContentHandlerImpl(global_state, app, std::move(request)), | 55 : ContentHandlerImpl(global_state, app, std::move(request)), |
| 56 test_interfaces_(test_interfaces), | 56 test_interfaces_(test_interfaces), |
| 57 test_delegate_(test_delegate), | 57 test_delegate_(test_delegate), |
| 58 web_widget_proxy_(nullptr), | 58 web_widget_proxy_(nullptr), |
| 59 app_refcount_(app->app_lifetime_helper()->CreateAppRefCount()) {} | 59 app_refcount_(app->app_lifetime_helper()->CreateAppRefCount()) {} |
| 60 | 60 |
| 61 LayoutTestContentHandlerImpl::~LayoutTestContentHandlerImpl() { | 61 LayoutTestContentHandlerImpl::~LayoutTestContentHandlerImpl() { |
| 62 } | 62 } |
| 63 | 63 |
| 64 void LayoutTestContentHandlerImpl::StartApplication( | 64 void LayoutTestContentHandlerImpl::StartApplication( |
| 65 mojo::InterfaceRequest<mojo::Application> request, | 65 mojo::ApplicationRequest request, |
| 66 mojo::URLResponsePtr response, | 66 mojo::URLResponsePtr response, |
| 67 const mojo::Callback<void()>& destruct_callback) { | 67 const mojo::Callback<void()>& destruct_callback) { |
| 68 test_interfaces_->SetTestIsRunning(true); | 68 test_interfaces_->SetTestIsRunning(true); |
| 69 test_interfaces_->ConfigureForTestWithURL(GURL(), false); | 69 test_interfaces_->ConfigureForTestWithURL(GURL(), false); |
| 70 | 70 |
| 71 // HTMLDocumentApplicationDelegate deletes itself. | 71 // HTMLDocumentApplicationDelegate deletes itself. |
| 72 HTMLDocumentApplicationDelegate* delegate = | 72 HTMLDocumentApplicationDelegate* delegate = |
| 73 new HTMLDocumentApplicationDelegate( | 73 new HTMLDocumentApplicationDelegate( |
| 74 std::move(request), std::move(response), global_state(), | 74 std::move(request), std::move(response), global_state(), |
| 75 app()->app_lifetime_helper()->CreateAppRefCount(), destruct_callback); | 75 app()->app_lifetime_helper()->CreateAppRefCount(), destruct_callback); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 103 proxy->set_base_proxy(web_widget_proxy_); | 103 proxy->set_base_proxy(web_widget_proxy_); |
| 104 test_delegate_->set_test_proxy(web_widget_proxy_); | 104 test_delegate_->set_test_proxy(web_widget_proxy_); |
| 105 test_interfaces_->SetWebView(web_widget_proxy_->web_view(), | 105 test_interfaces_->SetWebView(web_widget_proxy_->web_view(), |
| 106 web_widget_proxy_); | 106 web_widget_proxy_); |
| 107 web_widget_proxy_->set_widget(web_widget_proxy_->web_view()); | 107 web_widget_proxy_->set_widget(web_widget_proxy_->web_view()); |
| 108 test_interfaces_->BindTo(web_widget_proxy_->web_view()->mainFrame()); | 108 test_interfaces_->BindTo(web_widget_proxy_->web_view()->mainFrame()); |
| 109 return proxy; | 109 return proxy; |
| 110 } | 110 } |
| 111 | 111 |
| 112 } // namespace html_viewer | 112 } // namespace html_viewer |
| OLD | NEW |