| 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 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 if (connection_) | 336 if (connection_) |
| 337 CHECK_EQ(child->connection_, connection_); | 337 CHECK_EQ(child->connection_, connection_); |
| 338 for (const Window* p = child->parent(); p; p = p->parent()) { | 338 for (const Window* p = child->parent(); p; p = p->parent()) { |
| 339 if (p == this) | 339 if (p == this) |
| 340 return true; | 340 return true; |
| 341 } | 341 } |
| 342 return false; | 342 return false; |
| 343 } | 343 } |
| 344 | 344 |
| 345 void Window::AddTransientWindow(Window* transient_window) { | 345 void Window::AddTransientWindow(Window* transient_window) { |
| 346 // A system modal window cannot become a transient child. |
| 347 DCHECK(!transient_window->is_modal() || transient_window->transient_parent()); |
| 348 |
| 346 if (connection_) | 349 if (connection_) |
| 347 CHECK_EQ(transient_window->connection(), connection_); | 350 CHECK_EQ(transient_window->connection(), connection_); |
| 348 LocalAddTransientWindow(transient_window); | 351 LocalAddTransientWindow(transient_window); |
| 349 if (connection_) | 352 if (connection_) |
| 350 tree_client()->AddTransientWindow(this, transient_window->server_id()); | 353 tree_client()->AddTransientWindow(this, transient_window->server_id()); |
| 351 } | 354 } |
| 352 | 355 |
| 353 void Window::RemoveTransientWindow(Window* transient_window) { | 356 void Window::RemoveTransientWindow(Window* transient_window) { |
| 354 if (connection_) | 357 if (connection_) |
| 355 CHECK_EQ(transient_window->connection(), connection_); | 358 CHECK_EQ(transient_window->connection(), connection_); |
| (...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 867 notifier->NotifyWindowReordered(); | 870 notifier->NotifyWindowReordered(); |
| 868 | 871 |
| 869 return true; | 872 return true; |
| 870 } | 873 } |
| 871 | 874 |
| 872 // static | 875 // static |
| 873 Window** Window::GetStackingTarget(Window* window) { | 876 Window** Window::GetStackingTarget(Window* window) { |
| 874 return &window->stacking_target_; | 877 return &window->stacking_target_; |
| 875 } | 878 } |
| 876 } // namespace mus | 879 } // namespace mus |
| OLD | NEW |