| 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/connection_manager.h" | 5 #include "components/view_manager/connection_manager.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
| 9 #include "components/view_manager/client_connection.h" | 9 #include "components/view_manager/client_connection.h" |
| 10 #include "components/view_manager/connection_manager_delegate.h" | 10 #include "components/view_manager/connection_manager_delegate.h" |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 | 174 |
| 175 // Notify remaining connections so that they can cleanup. | 175 // Notify remaining connections so that they can cleanup. |
| 176 for (auto& pair : connection_map_) { | 176 for (auto& pair : connection_map_) { |
| 177 pair.second->service()->OnWillDestroyViewManagerServiceImpl( | 177 pair.second->service()->OnWillDestroyViewManagerServiceImpl( |
| 178 connection->service()); | 178 connection->service()); |
| 179 } | 179 } |
| 180 } | 180 } |
| 181 | 181 |
| 182 void ConnectionManager::EmbedAtView( | 182 void ConnectionManager::EmbedAtView( |
| 183 ConnectionSpecificId creator_id, | 183 ConnectionSpecificId creator_id, |
| 184 const std::string& url, | 184 mojo::URLRequestPtr request, |
| 185 const ViewId& view_id, | 185 const ViewId& view_id, |
| 186 mojo::InterfaceRequest<mojo::ServiceProvider> services, | 186 mojo::InterfaceRequest<mojo::ServiceProvider> services, |
| 187 mojo::ServiceProviderPtr exposed_services) { | 187 mojo::ServiceProviderPtr exposed_services) { |
| 188 std::string creator_url; | 188 std::string creator_url; |
| 189 ConnectionMap::const_iterator it = connection_map_.find(creator_id); | 189 ConnectionMap::const_iterator it = connection_map_.find(creator_id); |
| 190 if (it != connection_map_.end()) | 190 if (it != connection_map_.end()) |
| 191 creator_url = it->second->service()->url(); | 191 creator_url = it->second->service()->url(); |
| 192 | 192 |
| 193 mojo::ViewManagerServicePtr service_ptr; | 193 mojo::ViewManagerServicePtr service_ptr; |
| 194 ClientConnection* client_connection = | 194 ClientConnection* client_connection = |
| 195 delegate_->CreateClientConnectionForEmbedAtView( | 195 delegate_->CreateClientConnectionForEmbedAtView( |
| 196 this, GetProxy(&service_ptr), creator_id, creator_url, url, view_id); | 196 this, GetProxy(&service_ptr), creator_id, creator_url, request.Pass(), |
| 197 view_id); |
| 197 AddConnection(client_connection); | 198 AddConnection(client_connection); |
| 198 client_connection->service()->Init(client_connection->client(), | 199 client_connection->service()->Init(client_connection->client(), |
| 199 service_ptr.Pass(), services.Pass(), | 200 service_ptr.Pass(), services.Pass(), |
| 200 exposed_services.Pass()); | 201 exposed_services.Pass()); |
| 201 OnConnectionMessagedClient(client_connection->service()->id()); | 202 OnConnectionMessagedClient(client_connection->service()->id()); |
| 202 } | 203 } |
| 203 | 204 |
| 204 void ConnectionManager::EmbedAtView(mojo::ConnectionSpecificId creator_id, | 205 void ConnectionManager::EmbedAtView(mojo::ConnectionSpecificId creator_id, |
| 205 const ViewId& view_id, | 206 const ViewId& view_id, |
| 206 mojo::ViewManagerClientPtr client) { | 207 mojo::ViewManagerClientPtr client) { |
| (...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 598 if (wm_connection != owning_connection_old && | 599 if (wm_connection != owning_connection_old && |
| 599 wm_connection != embedded_connection_old && | 600 wm_connection != embedded_connection_old && |
| 600 wm_connection != owning_connection_new && | 601 wm_connection != owning_connection_new && |
| 601 wm_connection != embedded_connection_new) { | 602 wm_connection != embedded_connection_new) { |
| 602 wm_connection->ProcessFocusChanged(old_focused_view, new_focused_view); | 603 wm_connection->ProcessFocusChanged(old_focused_view, new_focused_view); |
| 603 } | 604 } |
| 604 } | 605 } |
| 605 } | 606 } |
| 606 | 607 |
| 607 } // namespace view_manager | 608 } // namespace view_manager |
| OLD | NEW |