OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |