Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(445)

Unified Diff: sky/viewer/document_view.cc

Issue 944733002: Sky should expose services provided to/by embedder (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/viewer/document_view.h ('k') | sky/viewer/internals.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_;
}
« no previous file with comments | « sky/viewer/document_view.h ('k') | sky/viewer/internals.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698