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

Side by Side 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: Addressed review comments 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/mus/ws/window_tree.h" 5 #include "components/mus/ws/window_tree.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 Operation op(this, window_server_, OperationType::ADD_TRANSIENT_WINDOW); 235 Operation op(this, window_server_, OperationType::ADD_TRANSIENT_WINDOW);
236 window->AddTransientWindow(transient_window); 236 window->AddTransientWindow(transient_window);
237 return true; 237 return true;
238 } 238 }
239 return false; 239 return false;
240 } 240 }
241 241
242 bool WindowTree::SetModal(const ClientWindowId& window_id) { 242 bool WindowTree::SetModal(const ClientWindowId& window_id) {
243 ServerWindow* window = GetWindowByClientId(window_id); 243 ServerWindow* window = GetWindowByClientId(window_id);
244 if (window && access_policy_->CanSetModal(window)) { 244 if (window && access_policy_->CanSetModal(window)) {
245 window->SetModal();
246 WindowManagerState* wms = GetWindowManagerState(window); 245 WindowManagerState* wms = GetWindowManagerState(window);
246 if (window->transient_parent()) {
247 window->SetModal();
248 } else if (user_id_ != InvalidUserId()) {
249 if (wms)
250 wms->AddSystemModalWindow(window);
251 } else {
252 return false;
253 }
247 if (wms) 254 if (wms)
248 wms->ReleaseCaptureBlockedByModalWindow(window); 255 wms->ReleaseCaptureBlockedByModalWindow(window);
249 return true; 256 return true;
250 } 257 }
251 return false; 258 return false;
252 } 259 }
253 260
254 std::vector<const ServerWindow*> WindowTree::GetWindowTree( 261 std::vector<const ServerWindow*> WindowTree::GetWindowTree(
255 const ClientWindowId& window_id) const { 262 const ClientWindowId& window_id) const {
256 const ServerWindow* window = GetWindowByClientId(window_id); 263 const ServerWindow* window = GetWindowByClientId(window_id);
(...skipping 1174 matching lines...) Expand 10 before | Expand all | Expand 10 after
1431 } 1438 }
1432 1439
1433 bool WindowTree::IsWindowRootOfAnotherTreeForAccessPolicy( 1440 bool WindowTree::IsWindowRootOfAnotherTreeForAccessPolicy(
1434 const ServerWindow* window) const { 1441 const ServerWindow* window) const {
1435 WindowTree* tree = window_server_->GetTreeWithRoot(window); 1442 WindowTree* tree = window_server_->GetTreeWithRoot(window);
1436 return tree && tree != this; 1443 return tree && tree != this;
1437 } 1444 }
1438 1445
1439 } // namespace ws 1446 } // namespace ws
1440 } // namespace mus 1447 } // namespace mus
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698