Index: sky/viewer/document_view.cc |
diff --git a/sky/viewer/document_view.cc b/sky/viewer/document_view.cc |
index e6fc4fa3ded4d8059dce5cf14b90a5c43e11789d..c7d6214a3dad50047a893cbd7925e6a3870e91cb 100644 |
--- a/sky/viewer/document_view.cc |
+++ b/sky/viewer/document_view.cc |
@@ -127,11 +127,15 @@ base::WeakPtr<DocumentView> DocumentView::GetWeakPtr() { |
void DocumentView::OnEmbed( |
mojo::View* root, |
- mojo::InterfaceRequest<mojo::ServiceProvider> services, |
- mojo::ServiceProviderPtr exposed_services) { |
+ mojo::InterfaceRequest<mojo::ServiceProvider> services_provided_to_embedder, |
+ mojo::ServiceProviderPtr embedder_provided_services) { |
root_ = root; |
- imported_services_ = exposed_services.Pass(); |
- navigator_host_.set_service_provider(imported_services_.get()); |
+ |
+ mojo::ConnectToService(embedder_provided_services.get(), &navigator_host_); |
+ mojo::ConnectToService(embedder_provided_services.get(), &test_harness_); |
+ |
+ services_provided_to_embedder_ = services_provided_to_embedder.Pass(); |
+ embedder_provided_services_ = embedder_provided_services.Pass(); |
Load(response_.Pass()); |
@@ -178,6 +182,18 @@ void DocumentView::GetPixelsForTesting(std::vector<unsigned char>* pixels) { |
return bitmap_rasterizer_->GetPixelsForTesting(pixels); |
} |
+TestHarnessPtr DocumentView::TakeTestHarness() { |
+ return test_harness_.Pass(); |
+} |
+ |
+mojo::ScopedMessagePipeHandle DocumentView::TakeServicesProvidedToEmbedder() { |
+ return services_provided_to_embedder_.PassMessagePipe(); |
+} |
+ |
+mojo::ScopedMessagePipeHandle DocumentView::TakeServicesProvidedByEmbedder() { |
+ return embedder_provided_services_.PassMessagePipe(); |
+} |
+ |
mojo::Shell* DocumentView::GetShell() { |
return shell_; |
} |