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

Unified Diff: components/mus/ws/window_tree.cc

Issue 1818333002: Reland: mus: Enable system modal windows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 8 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
Index: components/mus/ws/window_tree.cc
diff --git a/components/mus/ws/window_tree.cc b/components/mus/ws/window_tree.cc
index 0114bf5e89484c2ea0a5aa308e023c9861395187..31c1e9331dfa91e588bc4cdf55986da7f31a9086 100644
--- a/components/mus/ws/window_tree.cc
+++ b/components/mus/ws/window_tree.cc
@@ -242,8 +242,15 @@ bool WindowTree::AddTransientWindow(const ClientWindowId& window_id,
bool WindowTree::SetModal(const ClientWindowId& window_id) {
ServerWindow* window = GetWindowByClientId(window_id);
if (window && access_policy_->CanSetModal(window)) {
- window->SetModal();
WindowManagerState* wms = GetWindowManagerState(window);
+ if (window->transient_parent()) {
+ window->SetModal();
+ } else if (user_id_ != InvalidUserId()) {
+ if (wms)
+ wms->AddSystemModalWindow(window);
+ } else {
+ return false;
+ }
if (wms)
wms->ReleaseCaptureBlockedByModalWindow(window);
return true;

Powered by Google App Engine
This is Rietveld 408576698