Index: components/mus/ws/default_access_policy.cc |
diff --git a/components/mus/ws/default_access_policy.cc b/components/mus/ws/default_access_policy.cc |
index fb012f826202f0451d3ad238687664c32fd36a31..8948462965c7ca3983707e81b95b81d1c13a63f7 100644 |
--- a/components/mus/ws/default_access_policy.cc |
+++ b/components/mus/ws/default_access_policy.cc |
@@ -37,18 +37,18 @@ bool DefaultAccessPolicy::CanAddWindow(const ServerWindow* parent, |
bool DefaultAccessPolicy::CanAddTransientWindow( |
const ServerWindow* parent, |
const ServerWindow* child) const { |
- return WasCreatedByThisConnection(child) && |
+ return (delegate_->HasRootForAccessPolicy(child) || |
+ WasCreatedByThisConnection(child)) && |
(delegate_->HasRootForAccessPolicy(parent) || |
WasCreatedByThisConnection(parent)); |
} |
bool DefaultAccessPolicy::CanRemoveTransientWindowFromParent( |
const ServerWindow* window) const { |
- if (!WasCreatedByThisConnection(window)) |
- return false; // Can only unparent windows we created. |
- |
- return delegate_->HasRootForAccessPolicy(window->transient_parent()) || |
- WasCreatedByThisConnection(window->transient_parent()); |
+ return (delegate_->HasRootForAccessPolicy(window) || |
+ WasCreatedByThisConnection(window)) && |
+ (delegate_->HasRootForAccessPolicy(window->transient_parent()) || |
+ WasCreatedByThisConnection(window->transient_parent())); |
} |
bool DefaultAccessPolicy::CanReorderWindow( |