| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |