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 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
532 pair.first->ScheduleSurfaceDestruction(window); | 532 pair.first->ScheduleSurfaceDestruction(window); |
533 break; | 533 break; |
534 } | 534 } |
535 } | 535 } |
536 } | 536 } |
537 | 537 |
538 ServerWindow* ConnectionManager::FindWindowForSurface( | 538 ServerWindow* ConnectionManager::FindWindowForSurface( |
539 const ServerWindow* ancestor, | 539 const ServerWindow* ancestor, |
540 mojom::SurfaceType surface_type, | 540 mojom::SurfaceType surface_type, |
541 const ClientWindowId& client_window_id) { | 541 const ClientWindowId& client_window_id) { |
542 WindowTreeImpl* window_tree = GetConnection(ancestor->id().connection_id); | 542 WindowTreeImpl* window_tree; |
| 543 if (ancestor->id().connection_id == kInvalidConnectionId) |
| 544 window_tree = GetWindowTreeHostByWindow(ancestor)->GetWindowTree(); |
| 545 else |
| 546 window_tree = GetConnection(ancestor->id().connection_id); |
543 if (!window_tree) | 547 if (!window_tree) |
544 return nullptr; | 548 return nullptr; |
545 if (surface_type == mojom::SurfaceType::DEFAULT) { | 549 if (surface_type == mojom::SurfaceType::DEFAULT) { |
546 // At embed points the default surface comes from the embedded app. | 550 // At embed points the default surface comes from the embedded app. |
547 WindowTreeImpl* connection_with_root = GetConnectionWithRoot(ancestor); | 551 WindowTreeImpl* connection_with_root = GetConnectionWithRoot(ancestor); |
548 if (connection_with_root) | 552 if (connection_with_root) |
549 window_tree = connection_with_root; | 553 window_tree = connection_with_root; |
550 } | 554 } |
551 return window_tree->GetWindowByClientId(client_window_id); | 555 return window_tree->GetWindowByClientId(client_window_id); |
552 } | 556 } |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
689 if (!got_valid_frame_decorations_) { | 693 if (!got_valid_frame_decorations_) { |
690 display_manager_observers_.AddInterfacePtr(std::move(observer)); | 694 display_manager_observers_.AddInterfacePtr(std::move(observer)); |
691 return; | 695 return; |
692 } | 696 } |
693 CallOnDisplays(observer.get()); | 697 CallOnDisplays(observer.get()); |
694 display_manager_observers_.AddInterfacePtr(std::move(observer)); | 698 display_manager_observers_.AddInterfacePtr(std::move(observer)); |
695 } | 699 } |
696 | 700 |
697 } // namespace ws | 701 } // namespace ws |
698 } // namespace mus | 702 } // namespace mus |
OLD | NEW |