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/mus/ws/connection_manager.h" | 5 #include "components/mus/ws/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/mus/ws/client_connection.h" | 9 #include "components/mus/ws/client_connection.h" |
10 #include "components/mus/ws/connection_manager_delegate.h" | 10 #include "components/mus/ws/connection_manager_delegate.h" |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 // parent's lifetime. | 134 // parent's lifetime. |
135 host_connection_map_.erase(it); | 135 host_connection_map_.erase(it); |
136 OnConnectionError(service_connection_it->second); | 136 OnConnectionError(service_connection_it->second); |
137 | 137 |
138 // If we have no more roots left, let the app know so it can terminate. | 138 // If we have no more roots left, let the app know so it can terminate. |
139 if (!host_connection_map_.size()) | 139 if (!host_connection_map_.size()) |
140 delegate_->OnNoMoreRootConnections(); | 140 delegate_->OnNoMoreRootConnections(); |
141 } | 141 } |
142 | 142 |
143 WindowTreeImpl* ConnectionManager::EmbedAtWindow( | 143 WindowTreeImpl* ConnectionManager::EmbedAtWindow( |
144 ConnectionSpecificId creator_id, | |
145 const WindowId& window_id, | 144 const WindowId& window_id, |
146 uint32_t policy_bitmask, | 145 uint32_t policy_bitmask, |
147 mojom::WindowTreeClientPtr client) { | 146 mojom::WindowTreeClientPtr client) { |
148 mojom::WindowTreePtr service_ptr; | 147 mojom::WindowTreePtr service_ptr; |
149 ClientConnection* client_connection = | 148 ClientConnection* client_connection = |
150 delegate_->CreateClientConnectionForEmbedAtWindow( | 149 delegate_->CreateClientConnectionForEmbedAtWindow( |
151 this, GetProxy(&service_ptr), creator_id, window_id, policy_bitmask, | 150 this, GetProxy(&service_ptr), window_id, policy_bitmask, |
152 std::move(client)); | 151 std::move(client)); |
153 AddConnection(client_connection); | 152 AddConnection(client_connection); |
154 client_connection->service()->Init(client_connection->client(), | 153 client_connection->service()->Init(client_connection->client(), |
155 std::move(service_ptr)); | 154 std::move(service_ptr)); |
156 OnConnectionMessagedClient(client_connection->service()->id()); | 155 OnConnectionMessagedClient(client_connection->service()->id()); |
157 | 156 |
158 return client_connection->service(); | 157 return client_connection->service(); |
159 } | 158 } |
160 | 159 |
161 WindowTreeImpl* ConnectionManager::GetConnection( | 160 WindowTreeImpl* ConnectionManager::GetConnection( |
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
546 return; | 545 return; |
547 for (auto& pair : connection_map_) { | 546 for (auto& pair : connection_map_) { |
548 pair.second->service()->ProcessTransientWindowRemoved( | 547 pair.second->service()->ProcessTransientWindowRemoved( |
549 window, transient_child, IsOperationSource(pair.first)); | 548 window, transient_child, IsOperationSource(pair.first)); |
550 } | 549 } |
551 } | 550 } |
552 | 551 |
553 } // namespace ws | 552 } // namespace ws |
554 | 553 |
555 } // namespace mus | 554 } // namespace mus |
OLD | NEW |