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

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

Issue 1462123002: views/mus: Set-up transient windows correctly. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tot.merge 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/public/cpp/window_property.h ('k') | components/web_view/frame.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(
« no previous file with comments | « components/mus/public/cpp/window_property.h ('k') | components/web_view/frame.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698