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/frame_connection.h" | 5 #include "components/web_view/frame_connection.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "components/clipboard/public/interfaces/clipboard.mojom.h" | 9 #include "components/clipboard/public/interfaces/clipboard.mojom.h" |
10 #include "components/resource_provider/public/interfaces/resource_provider.mojom
.h" | 10 #include "components/resource_provider/public/interfaces/resource_provider.mojom
.h" |
11 #include "components/view_manager/public/interfaces/gpu.mojom.h" | 11 #include "components/view_manager/public/interfaces/gpu.mojom.h" |
12 #include "components/view_manager/public/interfaces/view_tree_host.mojom.h" | 12 #include "components/view_manager/public/interfaces/view_tree_host.mojom.h" |
13 #include "components/web_view/frame_tree.h" | 13 #include "components/web_view/frame_tree.h" |
| 14 #include "components/web_view/test_runner/public/interfaces/layout_test_runner.m
ojom.h" |
14 #include "mojo/application/public/cpp/application_connection.h" | 15 #include "mojo/application/public/cpp/application_connection.h" |
15 #include "mojo/application/public/cpp/application_impl.h" | 16 #include "mojo/application/public/cpp/application_impl.h" |
16 #include "mojo/services/network/public/interfaces/cookie_store.mojom.h" | 17 #include "mojo/services/network/public/interfaces/cookie_store.mojom.h" |
17 #include "mojo/services/network/public/interfaces/url_loader_factory.mojom.h" | 18 #include "mojo/services/network/public/interfaces/url_loader_factory.mojom.h" |
18 #include "mojo/services/network/public/interfaces/web_socket_factory.mojom.h" | 19 #include "mojo/services/network/public/interfaces/web_socket_factory.mojom.h" |
19 #include "mojo/services/tracing/public/interfaces/tracing.mojom.h" | 20 #include "mojo/services/tracing/public/interfaces/tracing.mojom.h" |
20 | 21 |
21 #if defined(OS_LINUX) && !defined(OS_ANDROID) | 22 #if defined(OS_LINUX) && !defined(OS_ANDROID) |
22 #include "components/font_service/public/interfaces/font_service.mojom.h" | 23 #include "components/font_service/public/interfaces/font_service.mojom.h" |
23 #endif | 24 #endif |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 | 88 |
88 mojo::Array<mojo::String> tracing_interfaces; | 89 mojo::Array<mojo::String> tracing_interfaces; |
89 tracing_interfaces.push_back(tracing::StartupPerformanceDataCollector::Name_); | 90 tracing_interfaces.push_back(tracing::StartupPerformanceDataCollector::Name_); |
90 filter->filter.insert("mojo:tracing", tracing_interfaces.Pass()); | 91 filter->filter.insert("mojo:tracing", tracing_interfaces.Pass()); |
91 | 92 |
92 mojo::Array<mojo::String> view_manager_interfaces; | 93 mojo::Array<mojo::String> view_manager_interfaces; |
93 view_manager_interfaces.push_back(mojo::Gpu::Name_); | 94 view_manager_interfaces.push_back(mojo::Gpu::Name_); |
94 view_manager_interfaces.push_back(mojo::ViewTreeHostFactory::Name_); | 95 view_manager_interfaces.push_back(mojo::ViewTreeHostFactory::Name_); |
95 filter->filter.insert("mojo:view_manager", view_manager_interfaces.Pass()); | 96 filter->filter.insert("mojo:view_manager", view_manager_interfaces.Pass()); |
96 | 97 |
| 98 mojo::Array<mojo::String> test_runner_interfaces; |
| 99 test_runner_interfaces.push_back(LayoutTestRunner::Name_); |
| 100 filter->filter.insert("mojo:web_view_test_runner", |
| 101 test_runner_interfaces.Pass()); |
| 102 |
97 #if defined(OS_LINUX) && !defined(OS_ANDROID) | 103 #if defined(OS_LINUX) && !defined(OS_ANDROID) |
98 mojo::Array<mojo::String> font_service_interfaces; | 104 mojo::Array<mojo::String> font_service_interfaces; |
99 font_service_interfaces.push_back(font_service::FontService::Name_); | 105 font_service_interfaces.push_back(font_service::FontService::Name_); |
100 filter->filter.insert("mojo:font_service", font_service_interfaces.Pass()); | 106 filter->filter.insert("mojo:font_service", font_service_interfaces.Pass()); |
101 #endif | 107 #endif |
102 | 108 |
103 application_connection_ = app->ConnectToApplicationWithCapabilityFilter( | 109 application_connection_ = app->ConnectToApplicationWithCapabilityFilter( |
104 request.Pass(), filter.Pass()); | 110 request.Pass(), filter.Pass()); |
105 application_connection_->ConnectToService(&frame_tree_client_); | 111 application_connection_->ConnectToService(&frame_tree_client_); |
106 frame_tree_client_.set_connection_error_handler([]() { | 112 frame_tree_client_.set_connection_error_handler([]() { |
(...skipping 12 matching lines...) Expand all Loading... |
119 } | 125 } |
120 | 126 |
121 uint32_t FrameConnection::GetContentHandlerID() const { | 127 uint32_t FrameConnection::GetContentHandlerID() const { |
122 uint32_t content_handler_id = mojo::Shell::kInvalidContentHandlerID; | 128 uint32_t content_handler_id = mojo::Shell::kInvalidContentHandlerID; |
123 if (!application_connection_->GetContentHandlerID(&content_handler_id)) | 129 if (!application_connection_->GetContentHandlerID(&content_handler_id)) |
124 NOTREACHED(); | 130 NOTREACHED(); |
125 return content_handler_id; | 131 return content_handler_id; |
126 } | 132 } |
127 | 133 |
128 } // namespace web_view | 134 } // namespace web_view |
OLD | NEW |