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

Side by Side Diff: components/mus/ws/connection_manager.cc

Issue 1639223003: Makes it so each windowtreeclient can use whatever ids it wants (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cleanup Created 4 years, 10 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 unified diff | Download patch
« no previous file with comments | « components/mus/ws/connection_manager.h ('k') | components/mus/ws/ids.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 return; 276 return;
277 } 277 }
278 278
279 WindowTreeImpl* connection = GetConnection(change.connection_id); 279 WindowTreeImpl* connection = GetConnection(change.connection_id);
280 connection->OnChangeCompleted(change.client_change_id, success); 280 connection->OnChangeCompleted(change.client_change_id, success);
281 } 281 }
282 282
283 void ConnectionManager::WindowManagerCreatedTopLevelWindow( 283 void ConnectionManager::WindowManagerCreatedTopLevelWindow(
284 WindowTreeImpl* wm_connection, 284 WindowTreeImpl* wm_connection,
285 uint32_t window_manager_change_id, 285 uint32_t window_manager_change_id,
286 Id transport_window_id) { 286 const ServerWindow* window) {
287 InFlightWindowManagerChange change; 287 InFlightWindowManagerChange change;
288 if (!GetAndClearInFlightWindowManagerChange(window_manager_change_id, 288 if (!GetAndClearInFlightWindowManagerChange(window_manager_change_id,
289 &change)) { 289 &change)) {
290 return; 290 return;
291 } 291 }
292 if (!window) {
293 WindowManagerSentBogusMessage();
294 return;
295 }
292 296
293 const WindowId window_id(WindowIdFromTransportId(transport_window_id));
294 const ServerWindow* window = GetWindow(window_id);
295 WindowTreeImpl* connection = GetConnection(change.connection_id); 297 WindowTreeImpl* connection = GetConnection(change.connection_id);
296 // The window manager should have created the window already, and it should 298 // The window manager should have created the window already, and it should
297 // be ready for embedding. 299 // be ready for embedding.
298 if (!connection->IsWaitingForNewTopLevelWindow(window_manager_change_id) || 300 if (!connection->IsWaitingForNewTopLevelWindow(window_manager_change_id) ||
299 !window || window->id().connection_id != wm_connection->id() || 301 !window || window->id().connection_id != wm_connection->id() ||
300 !window->children().empty() || GetConnectionWithRoot(window)) { 302 !window->children().empty() || GetConnectionWithRoot(window)) {
301 WindowManagerSentBogusMessage(connection); 303 WindowManagerSentBogusMessage();
302 return; 304 return;
303 } 305 }
304 306
305 connection->OnWindowManagerCreatedTopLevelWindow( 307 connection->OnWindowManagerCreatedTopLevelWindow(
306 window_manager_change_id, change.client_change_id, window_id); 308 window_manager_change_id, change.client_change_id, window);
307 } 309 }
308 310
309 void ConnectionManager::ProcessWindowBoundsChanged( 311 void ConnectionManager::ProcessWindowBoundsChanged(
310 const ServerWindow* window, 312 const ServerWindow* window,
311 const gfx::Rect& old_bounds, 313 const gfx::Rect& old_bounds,
312 const gfx::Rect& new_bounds) { 314 const gfx::Rect& new_bounds) {
313 for (auto& pair : connection_map_) { 315 for (auto& pair : connection_map_) {
314 pair.second->service()->ProcessWindowBoundsChanged( 316 pair.second->service()->ProcessWindowBoundsChanged(
315 window, old_bounds, new_bounds, IsOperationSource(pair.first)); 317 window, old_bounds, new_bounds, IsOperationSource(pair.first));
316 } 318 }
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
671 if (!got_valid_frame_decorations_) { 673 if (!got_valid_frame_decorations_) {
672 display_manager_observers_.AddInterfacePtr(std::move(observer)); 674 display_manager_observers_.AddInterfacePtr(std::move(observer));
673 return; 675 return;
674 } 676 }
675 CallOnDisplays(observer.get()); 677 CallOnDisplays(observer.get());
676 display_manager_observers_.AddInterfacePtr(std::move(observer)); 678 display_manager_observers_.AddInterfacePtr(std::move(observer));
677 } 679 }
678 680
679 } // namespace ws 681 } // namespace ws
680 } // namespace mus 682 } // namespace mus
OLDNEW
« no previous file with comments | « components/mus/ws/connection_manager.h ('k') | components/mus/ws/ids.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698