| 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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 return WasCreatedByThisClient(window) || | 148 return WasCreatedByThisClient(window) || |
| 149 delegate_->HasRootForAccessPolicy(window); | 149 delegate_->HasRootForAccessPolicy(window); |
| 150 } | 150 } |
| 151 | 151 |
| 152 bool DefaultAccessPolicy::CanSetCursorProperties( | 152 bool DefaultAccessPolicy::CanSetCursorProperties( |
| 153 const ServerWindow* window) const { | 153 const ServerWindow* window) const { |
| 154 return WasCreatedByThisClient(window) || | 154 return WasCreatedByThisClient(window) || |
| 155 delegate_->HasRootForAccessPolicy(window); | 155 delegate_->HasRootForAccessPolicy(window); |
| 156 } | 156 } |
| 157 | 157 |
| 158 bool DefaultAccessPolicy::CanInitiateMoveLoop( |
| 159 const ServerWindow* window) const { |
| 160 return delegate_->HasRootForAccessPolicy(window); |
| 161 } |
| 162 |
| 158 bool DefaultAccessPolicy::ShouldNotifyOnHierarchyChange( | 163 bool DefaultAccessPolicy::ShouldNotifyOnHierarchyChange( |
| 159 const ServerWindow* window, | 164 const ServerWindow* window, |
| 160 const ServerWindow** new_parent, | 165 const ServerWindow** new_parent, |
| 161 const ServerWindow** old_parent) const { | 166 const ServerWindow** old_parent) const { |
| 162 if (!WasCreatedByThisClient(window)) | 167 if (!WasCreatedByThisClient(window)) |
| 163 return false; | 168 return false; |
| 164 | 169 |
| 165 if (*new_parent && !WasCreatedByThisClient(*new_parent) && | 170 if (*new_parent && !WasCreatedByThisClient(*new_parent) && |
| 166 !delegate_->HasRootForAccessPolicy((*new_parent))) { | 171 !delegate_->HasRootForAccessPolicy((*new_parent))) { |
| 167 *new_parent = nullptr; | 172 *new_parent = nullptr; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 194 bool DefaultAccessPolicy::IsValidIdForNewWindow( | 199 bool DefaultAccessPolicy::IsValidIdForNewWindow( |
| 195 const ClientWindowId& id) const { | 200 const ClientWindowId& id) const { |
| 196 // Clients using DefaultAccessPolicy only see windows they have created (for | 201 // Clients using DefaultAccessPolicy only see windows they have created (for |
| 197 // the embed point they choose the id), so it's ok for clients to use whatever | 202 // the embed point they choose the id), so it's ok for clients to use whatever |
| 198 // id they want. | 203 // id they want. |
| 199 return true; | 204 return true; |
| 200 } | 205 } |
| 201 | 206 |
| 202 } // namespace ws | 207 } // namespace ws |
| 203 } // namespace mus | 208 } // namespace mus |
| OLD | NEW |