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

Side by Side Diff: components/mus/ws/default_access_policy.cc

Issue 1759523002: mus: Server-side implementation of modal windows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: SetAsModal -> SetModal + Other review comments addressed Created 4 years, 9 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
« no previous file with comments | « components/mus/ws/default_access_policy.h ('k') | components/mus/ws/event_dispatcher.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/default_access_policy.h" 5 #include "components/mus/ws/default_access_policy.h"
6 6
7 #include "components/mus/ws/access_policy_delegate.h" 7 #include "components/mus/ws/access_policy_delegate.h"
8 #include "components/mus/ws/server_window.h" 8 #include "components/mus/ws/server_window.h"
9 9
10 namespace mus { 10 namespace mus {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 } 44 }
45 45
46 bool DefaultAccessPolicy::CanRemoveTransientWindowFromParent( 46 bool DefaultAccessPolicy::CanRemoveTransientWindowFromParent(
47 const ServerWindow* window) const { 47 const ServerWindow* window) const {
48 return (delegate_->HasRootForAccessPolicy(window) || 48 return (delegate_->HasRootForAccessPolicy(window) ||
49 WasCreatedByThisConnection(window)) && 49 WasCreatedByThisConnection(window)) &&
50 (delegate_->HasRootForAccessPolicy(window->transient_parent()) || 50 (delegate_->HasRootForAccessPolicy(window->transient_parent()) ||
51 WasCreatedByThisConnection(window->transient_parent())); 51 WasCreatedByThisConnection(window->transient_parent()));
52 } 52 }
53 53
54 bool DefaultAccessPolicy::CanSetModal(const ServerWindow* window) const {
55 return delegate_->HasRootForAccessPolicy(window) ||
56 WasCreatedByThisConnection(window);
57 }
58
54 bool DefaultAccessPolicy::CanReorderWindow( 59 bool DefaultAccessPolicy::CanReorderWindow(
55 const ServerWindow* window, 60 const ServerWindow* window,
56 const ServerWindow* relative_window, 61 const ServerWindow* relative_window,
57 mojom::OrderDirection direction) const { 62 mojom::OrderDirection direction) const {
58 return WasCreatedByThisConnection(window) && 63 return WasCreatedByThisConnection(window) &&
59 WasCreatedByThisConnection(relative_window); 64 WasCreatedByThisConnection(relative_window);
60 } 65 }
61 66
62 bool DefaultAccessPolicy::CanDeleteWindow(const ServerWindow* window) const { 67 bool DefaultAccessPolicy::CanDeleteWindow(const ServerWindow* window) const {
63 return WasCreatedByThisConnection(window); 68 return WasCreatedByThisConnection(window);
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 } 191 }
187 192
188 bool DefaultAccessPolicy::IsDescendantOfEmbedRoot( 193 bool DefaultAccessPolicy::IsDescendantOfEmbedRoot(
189 const ServerWindow* window) const { 194 const ServerWindow* window) const {
190 return delegate_->IsDescendantOfEmbedRoot(window); 195 return delegate_->IsDescendantOfEmbedRoot(window);
191 } 196 }
192 197
193 } // namespace ws 198 } // namespace ws
194 199
195 } // namespace mus 200 } // namespace mus
OLDNEW
« no previous file with comments | « components/mus/ws/default_access_policy.h ('k') | components/mus/ws/event_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698