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

Unified Diff: components/mus/public/cpp/lib/window.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
Index: components/mus/public/cpp/lib/window.cc
diff --git a/components/mus/public/cpp/lib/window.cc b/components/mus/public/cpp/lib/window.cc
index bbbcc47dc4cc00bcb441157ddfdfa0352179f0ad..9d6157fd17db67d698ecb881ac25b10a564322e3 100644
--- a/components/mus/public/cpp/lib/window.cc
+++ b/components/mus/public/cpp/lib/window.cc
@@ -147,8 +147,7 @@ class ScopedSetBoundsNotifier {
// Some operations are only permitted in the connection that created the window.
bool OwnsWindow(WindowTreeConnection* connection, Window* window) {
return !connection ||
- static_cast<WindowTreeClientImpl*>(connection)
- ->OwnsWindow(window->id());
+ static_cast<WindowTreeClientImpl*>(connection)->OwnsWindow(window);
}
bool IsConnectionRoot(Window* window) {
@@ -274,6 +273,9 @@ void Window::AddChild(Window* child) {
// embeddee in an embedder-embeddee relationship.
if (connection_)
CHECK_EQ(child->connection(), connection_);
+ // Roots can not be added as children of other windows.
+ if (tree_client() && tree_client()->IsRoot(child))
+ return;
LocalAddChild(child);
if (connection_)
tree_client()->AddChild(this, child->id());
« no previous file with comments | « components/mus/public/cpp/lib/in_flight_change.h ('k') | components/mus/public/cpp/lib/window_tree_client_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698