| 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/viewer/internals.h" | 5 #include "sky/viewer/internals.h" |
| 6 | 6 |
| 7 #include "mojo/edk/js/core.h" | 7 #include "mojo/edk/js/core.h" |
| 8 #include "mojo/edk/js/handle.h" | 8 #include "mojo/edk/js/handle.h" |
| 9 #include "mojo/edk/js/support.h" | 9 #include "mojo/edk/js/support.h" |
| 10 #include "mojo/edk/js/threading.h" | 10 #include "mojo/edk/js/threading.h" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 mojo::MessagePipe pipe; | 92 mojo::MessagePipe pipe; |
| 93 document_view_->imported_services()->ConnectToService(interface_name, | 93 document_view_->imported_services()->ConnectToService(interface_name, |
| 94 pipe.handle1.Pass()); | 94 pipe.handle1.Pass()); |
| 95 return pipe.handle0.release(); | 95 return pipe.handle0.release(); |
| 96 } | 96 } |
| 97 | 97 |
| 98 // Returns a MessagePipe handle that's connected to this Shell. The caller | 98 // Returns a MessagePipe handle that's connected to this Shell. The caller |
| 99 // owns the handle and is expected to use it to create the JS Application for | 99 // owns the handle and is expected to use it to create the JS Application for |
| 100 // the DocumentView. | 100 // the DocumentView. |
| 101 mojo::Handle Internals::PassShellProxyHandle() { | 101 mojo::Handle Internals::PassShellProxyHandle() { |
| 102 mojo::MessagePipe pipe; | 102 mojo::ShellPtr shell; |
| 103 if (!shell_binding_.is_bound()) | 103 if (!shell_binding_.is_bound()) |
| 104 shell_binding_.Bind(pipe.handle0.Pass()); | 104 shell_binding_.Bind(GetProxy(&shell)); |
| 105 return pipe.handle1.release(); | 105 return shell.PassMessagePipe().release(); |
| 106 } | 106 } |
| 107 | 107 |
| 108 void Internals::ConnectToApplication( | 108 void Internals::ConnectToApplication( |
| 109 const mojo::String& application_url, | 109 const mojo::String& application_url, |
| 110 mojo::InterfaceRequest<mojo::ServiceProvider> services, | 110 mojo::InterfaceRequest<mojo::ServiceProvider> services, |
| 111 mojo::ServiceProviderPtr exposed_services) { | 111 mojo::ServiceProviderPtr exposed_services) { |
| 112 if (document_view_) { | 112 if (document_view_) { |
| 113 document_view_->shell()->ConnectToApplication( | 113 document_view_->shell()->ConnectToApplication( |
| 114 application_url, services.Pass(), exposed_services.Pass()); | 114 application_url, services.Pass(), exposed_services.Pass()); |
| 115 } | 115 } |
| (...skipping 14 matching lines...) Expand all Loading... |
| 130 } | 130 } |
| 131 | 131 |
| 132 void Internals::pauseAnimations(double pauseTime) { | 132 void Internals::pauseAnimations(double pauseTime) { |
| 133 if (pauseTime < 0) | 133 if (pauseTime < 0) |
| 134 return; | 134 return; |
| 135 | 135 |
| 136 document_view_->web_view()->mainFrame()->document().pauseAnimationsForTestin
g(pauseTime); | 136 document_view_->web_view()->mainFrame()->document().pauseAnimationsForTestin
g(pauseTime); |
| 137 } | 137 } |
| 138 | 138 |
| 139 } // namespace sky | 139 } // namespace sky |
| OLD | NEW |