Chromium Code Reviews| Index: ash/mus/window_manager.cc |
| diff --git a/ash/mus/window_manager.cc b/ash/mus/window_manager.cc |
| index 3476cc5f50d21775db6d12b1fa4bf715074796a2..fc150eceb412c0d4185b08807ff73da1f331cc5c 100644 |
| --- a/ash/mus/window_manager.cc |
| +++ b/ash/mus/window_manager.cc |
| @@ -38,6 +38,7 @@ |
| #include "services/ui/public/cpp/property_type_converters.h" |
| #include "services/ui/public/interfaces/constants.mojom.h" |
| #include "services/ui/public/interfaces/window_manager.mojom.h" |
| +#include "ui/aura/client/aura_constants.h" |
| #include "ui/aura/client/window_parenting_client.h" |
| #include "ui/aura/env.h" |
| #include "ui/aura/mus/capture_synchronizer.h" |
| @@ -323,6 +324,23 @@ bool WindowManager::OnWmSetProperty( |
| return false; |
| } |
| +void WindowManager::OnWmSetModalType(aura::Window* window, ui::ModalType type) { |
| + ui::ModalType old_type = window->GetProperty(aura::client::kModalKey); |
| + if (type == old_type) |
| + return; |
| + |
| + window->SetProperty(aura::client::kModalKey, type); |
|
sky
2017/03/20 20:14:30
If the property changes from system shouldn't you
Hadi
2017/03/20 20:28:58
Right. The following if won't return if old_type i
|
| + if (type != ui::MODAL_TYPE_SYSTEM && old_type != ui::MODAL_TYPE_SYSTEM) |
| + return; |
| + |
| + WmWindow* new_parent = |
| + wm::GetDefaultParent(WmWindow::Get(window), window->bounds()); |
| + DCHECK(window->parent()); |
|
sky
2017/03/20 20:14:30
Why should the window already have a parent?
Hadi
2017/03/20 20:28:58
Done.
|
| + window->parent()->RemoveChild(window); |
| + DCHECK(new_parent); |
| + new_parent->aura_window()->AddChild(window); |
| +} |
| + |
| void WindowManager::OnWmSetCanFocus(aura::Window* window, bool can_focus) { |
| NonClientFrameController* non_client_frame_controller = |
| NonClientFrameController::Get(window); |