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

Unified Diff: services/ui/ws/window_tree.cc

Issue 2577963006: Revert of Converts chrome to aura-mus (Closed)
Patch Set: Created 4 years 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/exo/wm_helper_mus.cc ('k') | ui/aura/mus/focus_synchronizer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/ws/window_tree.cc
diff --git a/services/ui/ws/window_tree.cc b/services/ui/ws/window_tree.cc
index a9d098e8e875b8bb58e9885717c5aa61d75b0c71..4b435876a269d5eceac4da35b8a233c72b95a2c8 100644
--- a/services/ui/ws/window_tree.cc
+++ b/services/ui/ws/window_tree.cc
@@ -283,35 +283,13 @@
const ClientWindowId& child_id) {
ServerWindow* parent = GetWindowByClientId(parent_id);
ServerWindow* child = GetWindowByClientId(child_id);
- DVLOG(3) << "add window client=" << id_
- << " client parent window_id=" << parent_id.id
- << " global window_id="
- << (parent ? WindowIdToTransportId(parent->id()) : 0)
- << " client child window_id= " << child_id.id << " global window_id="
- << (child ? WindowIdToTransportId(child->id()) : 0);
- if (!parent) {
- DVLOG(1) << "add failed, no parent";
- return false;
- }
- if (!child) {
- DVLOG(1) << "add failed, no child";
- return false;
- }
- if (child->parent() == parent) {
- DVLOG(1) << "add failed, already has parent";
- return false;
- }
- if (child->Contains(parent)) {
- DVLOG(1) << "add failed, child contains parent";
- return false;
- }
- if (!access_policy_->CanAddWindow(parent, child)) {
- DVLOG(1) << "add failed, access policy denied add";
- return false;
- }
- Operation op(this, window_server_, OperationType::ADD_WINDOW);
- parent->Add(child);
- return true;
+ if (parent && child && child->parent() != parent &&
+ !child->Contains(parent) && access_policy_->CanAddWindow(parent, child)) {
+ Operation op(this, window_server_, OperationType::ADD_WINDOW);
+ parent->Add(child);
+ return true;
+ }
+ return false;
}
bool WindowTree::AddTransientWindow(const ClientWindowId& window_id,
« no previous file with comments | « components/exo/wm_helper_mus.cc ('k') | ui/aura/mus/focus_synchronizer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698