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 "mojo/apps/js/application_delegate_impl.h" | 5 #include "mojo/apps/js/application_delegate_impl.h" |
6 | 6 |
7 #include "gin/array_buffer.h" | 7 #include "gin/array_buffer.h" |
8 #include "gin/public/isolate_holder.h" | 8 #include "gin/public/isolate_holder.h" |
9 #include "mojo/apps/js/js_app.h" | 9 #include "mojo/apps/js/js_app.h" |
10 #include "mojo/public/cpp/application/application_impl.h" | 10 #include "mojo/public/cpp/application/application_impl.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 | 34 |
35 void ApplicationDelegateImpl::QuitJSApp(JSApp* app) { | 35 void ApplicationDelegateImpl::QuitJSApp(JSApp* app) { |
36 AppVector::iterator itr = | 36 AppVector::iterator itr = |
37 std::find(app_vector_.begin(), app_vector_.end(), app); | 37 std::find(app_vector_.begin(), app_vector_.end(), app); |
38 if (itr != app_vector_.end()) | 38 if (itr != app_vector_.end()) |
39 app_vector_.erase(itr); | 39 app_vector_.erase(itr); |
40 if (app_vector_.empty()) | 40 if (app_vector_.empty()) |
41 base::MessageLoop::current()->QuitNow(); | 41 base::MessageLoop::current()->QuitNow(); |
42 } | 42 } |
43 | 43 |
44 void ApplicationDelegateImpl::ConnectToService( | 44 void ApplicationDelegateImpl::ConnectToApplication( |
45 ScopedMessagePipeHandle pipe_handle, | |
46 const std::string& application_url, | 45 const std::string& application_url, |
47 const std::string& interface_name) { | 46 ScopedMessagePipeHandle pipe_handle) { |
48 CHECK(application_impl_); | 47 CHECK(application_impl_); |
49 ServiceProvider* service_provider = | 48 application_impl_->shell()->ConnectToApplication( |
50 application_impl_->ConnectToApplication(application_url) | 49 application_url, MakeRequest<ServiceProvider>(pipe_handle.Pass())); |
51 ->GetServiceProvider(); | |
52 service_provider->ConnectToService(interface_name, pipe_handle.Pass()); | |
53 } | 50 } |
54 | 51 |
55 } // namespace apps | 52 } // namespace apps |
56 } // namespace mojo | 53 } // namespace mojo |
OLD | NEW |