Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3853)

Unified Diff: ash/mus/window_manager.cc

Issue 2759643003: Add system modals to the proper container in mus+ash. (Closed)
Patch Set: Remove extra code. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/mus/window_manager.h ('k') | mash/simple_wm/simple_wm.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/mus/window_manager.cc
diff --git a/ash/mus/window_manager.cc b/ash/mus/window_manager.cc
index 8818e3cbdd393d96889b57860a3bdf4eaa865c69..ed4bdaad6971370bdb9d73a9035f5e688a06c092 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"
@@ -321,6 +322,24 @@ bool WindowManager::OnWmSetProperty(
return false;
}
+void WindowManager::OnWmSetModalType(aura::Window* window, ui::ModalType type) {
sky 2017/03/17 21:37:46 I'm a little surprised we need this, but I guess t
+ ui::ModalType old_type = window->GetProperty(aura::client::kModalKey);
+ if (type == old_type)
+ return;
+
+ window->SetProperty(aura::client::kModalKey, type);
+ if (type != ui::MODAL_TYPE_SYSTEM && old_type != ui::MODAL_TYPE_SYSTEM)
+ return;
+
+ if (window->parent())
+ window->parent()->RemoveChild(window);
+ int32_t new_container_id = type == ui::MODAL_TYPE_SYSTEM
sky 2017/03/17 21:37:46 Can you use GetDefaultParent? In container_finder?
Hadi 2017/03/20 15:03:29 Done.
+ ? kShellWindowId_SystemModalContainer
+ : kShellWindowId_DefaultContainer;
+ Shell::GetContainer(Shell::GetPrimaryRootWindow(), new_container_id)
+ ->AddChild(window);
+}
+
void WindowManager::OnWmSetCanFocus(aura::Window* window, bool can_focus) {
NonClientFrameController* non_client_frame_controller =
NonClientFrameController::Get(window);
« no previous file with comments | « ash/mus/window_manager.h ('k') | mash/simple_wm/simple_wm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698