| 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 "components/mus/public/cpp/window.h" | 5 #include "components/mus/public/cpp/window.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <set> | 10 #include <set> |
| (...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 return; | 309 return; |
| 310 Reorder(parent_->children_.back(), mojom::OrderDirection::ABOVE); | 310 Reorder(parent_->children_.back(), mojom::OrderDirection::ABOVE); |
| 311 } | 311 } |
| 312 | 312 |
| 313 void Window::MoveToBack() { | 313 void Window::MoveToBack() { |
| 314 if (!parent_ || parent_->children_.front() == this) | 314 if (!parent_ || parent_->children_.front() == this) |
| 315 return; | 315 return; |
| 316 Reorder(parent_->children_.front(), mojom::OrderDirection::BELOW); | 316 Reorder(parent_->children_.front(), mojom::OrderDirection::BELOW); |
| 317 } | 317 } |
| 318 | 318 |
| 319 bool Window::Contains(Window* child) const { | 319 bool Window::Contains(const Window* child) const { |
| 320 if (!child) | 320 if (!child) |
| 321 return false; | 321 return false; |
| 322 if (child == this) | 322 if (child == this) |
| 323 return true; | 323 return true; |
| 324 if (connection_) | 324 if (connection_) |
| 325 CHECK_EQ(child->connection(), connection_); | 325 CHECK_EQ(child->connection_, connection_); |
| 326 for (Window* p = child->parent(); p; p = p->parent()) { | 326 for (const Window* p = child->parent(); p; p = p->parent()) { |
| 327 if (p == this) | 327 if (p == this) |
| 328 return true; | 328 return true; |
| 329 } | 329 } |
| 330 return false; | 330 return false; |
| 331 } | 331 } |
| 332 | 332 |
| 333 void Window::AddTransientWindow(Window* transient_window) { | 333 void Window::AddTransientWindow(Window* transient_window) { |
| 334 if (connection_) | 334 if (connection_) |
| 335 CHECK_EQ(transient_window->connection(), connection_); | 335 CHECK_EQ(transient_window->connection(), connection_); |
| 336 LocalAddTransientWindow(transient_window); | 336 LocalAddTransientWindow(transient_window); |
| (...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 838 notifier->NotifyWindowReordered(); | 838 notifier->NotifyWindowReordered(); |
| 839 | 839 |
| 840 return true; | 840 return true; |
| 841 } | 841 } |
| 842 | 842 |
| 843 // static | 843 // static |
| 844 Window** Window::GetStackingTarget(Window* window) { | 844 Window** Window::GetStackingTarget(Window* window) { |
| 845 return &window->stacking_target_; | 845 return &window->stacking_target_; |
| 846 } | 846 } |
| 847 } // namespace mus | 847 } // namespace mus |
| OLD | NEW |