Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(254)

Unified Diff: components/mus/ws/connection_manager.cc

Issue 1567623003: Adds remainder of support for multiple roots to WS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix comment Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/mus/ws/connection_manager.h ('k') | components/mus/ws/window_tree_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/mus/ws/connection_manager.cc
diff --git a/components/mus/ws/connection_manager.cc b/components/mus/ws/connection_manager.cc
index 673307629ab1cbfd8d19ca7be8e51805e6d8e972..c5cc71c1273aa08420ada93ddc50132baeeda979 100644
--- a/components/mus/ws/connection_manager.cc
+++ b/components/mus/ws/connection_manager.cc
@@ -138,6 +138,11 @@ void ConnectionManager::OnHostConnectionClosed(
host_connection_map_.erase(it);
OnConnectionError(service_connection_it->second);
+ for (auto& pair : connection_map_) {
+ pair.second->service()->OnWillDestroyWindowTreeHost(
+ connection->window_tree_host());
+ }
+
// If we have no more roots left, let the app know so it can terminate.
if (!host_connection_map_.size())
delegate_->OnNoMoreRootConnections();
@@ -270,6 +275,32 @@ void ConnectionManager::WindowManagerChangeCompleted(
connection->OnChangeCompleted(change.client_change_id, success);
}
+void ConnectionManager::WindowManagerCreatedTopLevelWindow(
+ WindowTreeImpl* wm_connection,
+ uint32_t window_manager_change_id,
+ Id transport_window_id) {
+ InFlightWindowManagerChange change;
+ if (!GetAndClearInFlightWindowManagerChange(window_manager_change_id,
+ &change)) {
+ return;
+ }
+
+ const WindowId window_id(WindowIdFromTransportId(transport_window_id));
+ const ServerWindow* window = GetWindow(window_id);
+ WindowTreeImpl* connection = GetConnection(change.connection_id);
+ // The window manager should have created the window already, and it should
+ // be ready for embedding.
+ if (!connection->IsWaitingForNewTopLevelWindow(window_manager_change_id) ||
+ !window || window->id().connection_id != wm_connection->id() ||
+ !window->children().empty() || GetConnectionWithRoot(window)) {
+ WindowManagerSentBogusMessage(connection);
+ return;
+ }
+
+ connection->OnWindowManagerCreatedTopLevelWindow(
+ window_manager_change_id, change.client_change_id, window_id);
+}
+
void ConnectionManager::ProcessWindowBoundsChanged(
const ServerWindow* window,
const gfx::Rect& old_bounds,
« no previous file with comments | « components/mus/ws/connection_manager.h ('k') | components/mus/ws/window_tree_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698