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

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 after fixing the crash Created 4 years, 7 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 | « components/mus/ws/window_manager_state.cc ('k') | components/mus/ws/window_tree_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/mus/ws/window_tree.cc
diff --git a/components/mus/ws/window_tree.cc b/components/mus/ws/window_tree.cc
index 14e6a6e7895fb81f6a350a09f23a2a83e657ef18..3fd3f453757595b689f5ce4afc3cc86389323b44 100644
--- a/components/mus/ws/window_tree.cc
+++ b/components/mus/ws/window_tree.cc
@@ -234,8 +234,7 @@ bool WindowTree::AddTransientWindow(const ClientWindowId& window_id,
if (window && transient_window && !transient_window->Contains(window) &&
access_policy_->CanAddTransientWindow(window, transient_window)) {
Operation op(this, window_server_, OperationType::ADD_TRANSIENT_WINDOW);
- window->AddTransientWindow(transient_window);
- return true;
+ return window->AddTransientWindow(transient_window);
}
return false;
}
@@ -243,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;
« no previous file with comments | « components/mus/ws/window_manager_state.cc ('k') | components/mus/ws/window_tree_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698