Index: sky/viewer/internals.cc |
diff --git a/sky/viewer/internals.cc b/sky/viewer/internals.cc |
index 99e8c3bef07240ac249e64f17567318dbfef5497..031622c10114e2cb0564f2c0e376763bf719e1d5 100644 |
--- a/sky/viewer/internals.cc |
+++ b/sky/viewer/internals.cc |
@@ -49,6 +49,8 @@ gin::ObjectTemplateBuilder Internals::GetObjectTemplateBuilder( |
.SetMethod("contentAsText", &Internals::ContentAsText) |
.SetMethod("notifyTestComplete", &Internals::NotifyTestComplete) |
.SetMethod("connectToService", &Internals::ConnectToService) |
+ .SetMethod("connectToEmbedderService", |
+ &Internals::ConnectToEmbedderService) |
.SetMethod("pauseAnimations", &Internals::pauseAnimations); |
} |
@@ -72,6 +74,17 @@ void Internals::NotifyTestComplete(const std::string& test_result) { |
mojo::Array<uint8_t>::From(pixels)); |
} |
+mojo::Handle Internals::ConnectToEmbedderService( |
+ const std::string& interface_name) { |
+ if (!document_view_) |
+ return mojo::Handle(); |
+ |
+ mojo::MessagePipe pipe; |
+ document_view_->imported_services()->ConnectToService(interface_name, |
+ pipe.handle1.Pass()); |
+ return pipe.handle0.release(); |
+} |
+ |
mojo::Handle Internals::ConnectToService( |
const std::string& application_url, const std::string& interface_name) { |
if (!document_view_) |