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

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: Cleaned up comments 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 863a3a13e61a2095581b0f08fac3b089e39daa76..ea327d49649c3d4d1449d721ba2568e58b39b900 100644
--- a/components/mus/ws/window_tree.cc
+++ b/components/mus/ws/window_tree.cc
@@ -238,14 +238,20 @@ bool WindowTree::AddTransientWindow(const ClientWindowId& window_id,
bool WindowTree::SetModal(const ClientWindowId& window_id) {
ServerWindow* window = GetWindowByClientId(window_id);
+ bool success = false;
if (window && access_policy_->CanSetModal(window)) {
- window->SetModal();
WindowManagerState* wms = GetWindowManagerState(window);
- if (wms)
+ if (window->transient_parent()) {
+ window->SetModal();
+ success = true;
+ } else {
+ success = user_id_ != InvalidUserId() && wms &&
+ wms->SetSystemModalWindow(window);
sky 2016/04/20 20:14:12 This is problematic because you're assuming there
mohsen 2016/04/21 17:58:43 What would exactly not work in your example? The c
+ }
+ if (success)
wms->ReleaseCaptureBlockedByModalWindow(window);
- return true;
}
- return false;
+ return success;
}
std::vector<const ServerWindow*> WindowTree::GetWindowTree(

Powered by Google App Engine
This is Rietveld 408576698