| 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 "components/view_manager/view_manager_app.h" | 5 #include "components/view_manager/view_manager_app.h" |
| 6 | 6 |
| 7 #include "components/view_manager/client_connection.h" | 7 #include "components/view_manager/client_connection.h" |
| 8 #include "components/view_manager/connection_manager.h" | 8 #include "components/view_manager/connection_manager.h" |
| 9 #include "components/view_manager/display_manager.h" | 9 #include "components/view_manager/display_manager.h" |
| 10 #include "components/view_manager/view_manager_service_impl.h" | 10 #include "components/view_manager/view_manager_service_impl.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 | 55 |
| 56 void ViewManagerApp::OnLostConnectionToWindowManager() { | 56 void ViewManagerApp::OnLostConnectionToWindowManager() { |
| 57 ApplicationImpl::Terminate(); | 57 ApplicationImpl::Terminate(); |
| 58 } | 58 } |
| 59 | 59 |
| 60 ClientConnection* ViewManagerApp::CreateClientConnectionForEmbedAtView( | 60 ClientConnection* ViewManagerApp::CreateClientConnectionForEmbedAtView( |
| 61 ConnectionManager* connection_manager, | 61 ConnectionManager* connection_manager, |
| 62 mojo::InterfaceRequest<mojo::ViewManagerService> service_request, | 62 mojo::InterfaceRequest<mojo::ViewManagerService> service_request, |
| 63 mojo::ConnectionSpecificId creator_id, | 63 mojo::ConnectionSpecificId creator_id, |
| 64 const std::string& creator_url, | 64 const std::string& creator_url, |
| 65 const std::string& url, | 65 mojo::URLRequestPtr request, |
| 66 const ViewId& root_id) { | 66 const ViewId& root_id) { |
| 67 mojo::ViewManagerClientPtr client; | 67 mojo::ViewManagerClientPtr client; |
| 68 app_impl_->ConnectToService(url, &client); | 68 std::string url = request->url.To<std::string>(); |
| 69 app_impl_->ConnectToService(request.Pass(), &client); |
| 69 | 70 |
| 70 scoped_ptr<ViewManagerServiceImpl> service(new ViewManagerServiceImpl( | 71 scoped_ptr<ViewManagerServiceImpl> service(new ViewManagerServiceImpl( |
| 71 connection_manager, creator_id, creator_url, url, root_id)); | 72 connection_manager, creator_id, creator_url, url, root_id)); |
| 72 return new DefaultClientConnection(service.Pass(), connection_manager, | 73 return new DefaultClientConnection(service.Pass(), connection_manager, |
| 73 service_request.Pass(), client.Pass()); | 74 service_request.Pass(), client.Pass()); |
| 74 } | 75 } |
| 75 | 76 |
| 76 ClientConnection* ViewManagerApp::CreateClientConnectionForEmbedAtView( | 77 ClientConnection* ViewManagerApp::CreateClientConnectionForEmbedAtView( |
| 77 ConnectionManager* connection_manager, | 78 ConnectionManager* connection_manager, |
| 78 mojo::InterfaceRequest<mojo::ViewManagerService> service_request, | 79 mojo::InterfaceRequest<mojo::ViewManagerService> service_request, |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 view_manager_root_binding_.reset(new mojo::Binding<ViewManagerRoot>( | 120 view_manager_root_binding_.reset(new mojo::Binding<ViewManagerRoot>( |
| 120 connection_manager_.get(), request.Pass())); | 121 connection_manager_.get(), request.Pass())); |
| 121 view_manager_root_binding_->set_error_handler(this); | 122 view_manager_root_binding_->set_error_handler(this); |
| 122 } | 123 } |
| 123 | 124 |
| 124 void ViewManagerApp::OnConnectionError() { | 125 void ViewManagerApp::OnConnectionError() { |
| 125 ApplicationImpl::Terminate(); | 126 ApplicationImpl::Terminate(); |
| 126 } | 127 } |
| 127 | 128 |
| 128 } // namespace view_manager | 129 } // namespace view_manager |
| OLD | NEW |