Chromium Code Reviews| 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( |