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

Side by Side Diff: services/ui/ws/server_window.cc

Issue 2692223003: Remove FrameSinkId hierarchy when unparenting ServerWindow. (Closed)
Patch Set: Created 3 years, 10 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "services/ui/ws/server_window.h" 5 #include "services/ui/ws/server_window.h"
6 6
7 #include <inttypes.h> 7 #include <inttypes.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 } 139 }
140 140
141 void ServerWindow::Remove(ServerWindow* child) { 141 void ServerWindow::Remove(ServerWindow* child) {
142 // We assume validation checks happened else where. 142 // We assume validation checks happened else where.
143 DCHECK(child); 143 DCHECK(child);
144 DCHECK(child != this); 144 DCHECK(child != this);
145 DCHECK(child->parent() == this); 145 DCHECK(child->parent() == this);
146 146
147 for (auto& observer : child->observers_) 147 for (auto& observer : child->observers_)
148 observer.OnWillChangeWindowHierarchy(child, nullptr, this); 148 observer.OnWillChangeWindowHierarchy(child, nullptr, this);
149
149 RemoveImpl(child); 150 RemoveImpl(child);
150 151
152 if (GetRoot() != nullptr)
153 child->ProcessRootChanged(GetRoot(), nullptr);
154
151 // Stack the child properly if it is a transient child of a sibling. 155 // Stack the child properly if it is a transient child of a sibling.
152 if (child->transient_parent_ && child->transient_parent_->parent() == this) 156 if (child->transient_parent_ && child->transient_parent_->parent() == this)
153 RestackTransientDescendants(child->transient_parent_, &GetStackingTarget, 157 RestackTransientDescendants(child->transient_parent_, &GetStackingTarget,
154 &ReorderImpl); 158 &ReorderImpl);
155 159
156 for (auto& observer : child->observers_) 160 for (auto& observer : child->observers_)
157 observer.OnWindowHierarchyChanged(child, nullptr, this); 161 observer.OnWindowHierarchyChanged(child, nullptr, this);
158 } 162 }
159 163
160 void ServerWindow::Reorder(ServerWindow* relative, 164 void ServerWindow::Reorder(ServerWindow* relative,
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
477 window->OnStackingChanged(); 481 window->OnStackingChanged();
478 } 482 }
479 483
480 // static 484 // static
481 ServerWindow** ServerWindow::GetStackingTarget(ServerWindow* window) { 485 ServerWindow** ServerWindow::GetStackingTarget(ServerWindow* window) {
482 return &window->stacking_target_; 486 return &window->stacking_target_;
483 } 487 }
484 488
485 } // namespace ws 489 } // namespace ws
486 } // namespace ui 490 } // namespace ui
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698