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 | |
349 if (connection_) | 346 if (connection_) |
350 CHECK_EQ(transient_window->connection(), connection_); | 347 CHECK_EQ(transient_window->connection(), connection_); |
351 LocalAddTransientWindow(transient_window); | 348 LocalAddTransientWindow(transient_window); |
352 if (connection_) | 349 if (connection_) |
353 tree_client()->AddTransientWindow(this, transient_window->server_id()); | 350 tree_client()->AddTransientWindow(this, transient_window->server_id()); |
354 } | 351 } |
355 | 352 |
356 void Window::RemoveTransientWindow(Window* transient_window) { | 353 void Window::RemoveTransientWindow(Window* transient_window) { |
357 if (connection_) | 354 if (connection_) |
358 CHECK_EQ(transient_window->connection(), connection_); | 355 CHECK_EQ(transient_window->connection(), connection_); |
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
870 notifier->NotifyWindowReordered(); | 867 notifier->NotifyWindowReordered(); |
871 | 868 |
872 return true; | 869 return true; |
873 } | 870 } |
874 | 871 |
875 // static | 872 // static |
876 Window** Window::GetStackingTarget(Window* window) { | 873 Window** Window::GetStackingTarget(Window* window) { |
877 return &window->stacking_target_; | 874 return &window->stacking_target_; |
878 } | 875 } |
879 } // namespace mus | 876 } // namespace mus |
OLD | NEW |