| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "sky/engine/config.h" | 5 #include "sky/engine/config.h" |
| 6 #include "sky/viewer/internals.h" | 6 #include "sky/viewer/internals.h" |
| 7 | 7 |
| 8 #include "mojo/public/cpp/application/connect.h" | 8 #include "mojo/public/cpp/application/connect.h" |
| 9 #include "mojo/public/cpp/bindings/array.h" | 9 #include "mojo/public/cpp/bindings/array.h" |
| 10 #include "sky/engine/public/web/WebDocument.h" | 10 #include "sky/engine/public/web/WebDocument.h" |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 return document_view_->TakeServiceRegistry().release(); | 165 return document_view_->TakeServiceRegistry().release(); |
| 166 } | 166 } |
| 167 | 167 |
| 168 // Returns a MessagePipe handle that's connected to this Shell. The caller | 168 // Returns a MessagePipe handle that's connected to this Shell. The caller |
| 169 // owns the handle and is expected to use it to create the JS Application for | 169 // owns the handle and is expected to use it to create the JS Application for |
| 170 // the DocumentView. | 170 // the DocumentView. |
| 171 mojo::Handle Internals::TakeShellProxyHandle() { | 171 mojo::Handle Internals::TakeShellProxyHandle() { |
| 172 mojo::ShellPtr shell; | 172 mojo::ShellPtr shell; |
| 173 if (!shell_binding_.is_bound()) | 173 if (!shell_binding_.is_bound()) |
| 174 shell_binding_.Bind(GetProxy(&shell)); | 174 shell_binding_.Bind(GetProxy(&shell)); |
| 175 return shell.PassMessagePipe().release(); | 175 return shell.PassInterface().PassHandle().release(); |
| 176 } | 176 } |
| 177 | 177 |
| 178 void Internals::ConnectToApplication( | 178 void Internals::ConnectToApplication( |
| 179 const mojo::String& application_url, | 179 const mojo::String& application_url, |
| 180 mojo::InterfaceRequest<mojo::ServiceProvider> services, | 180 mojo::InterfaceRequest<mojo::ServiceProvider> services, |
| 181 mojo::ServiceProviderPtr exposed_services) { | 181 mojo::ServiceProviderPtr exposed_services) { |
| 182 if (document_view_) { | 182 if (document_view_) { |
| 183 document_view_->shell()->ConnectToApplication( | 183 document_view_->shell()->ConnectToApplication( |
| 184 application_url, services.Pass(), exposed_services.Pass()); | 184 application_url, services.Pass(), exposed_services.Pass()); |
| 185 } | 185 } |
| 186 } | 186 } |
| 187 | 187 |
| 188 } // namespace sky | 188 } // namespace sky |
| OLD | NEW |