| 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 "services/ui/ws/default_access_policy.h" | 5 #include "services/ui/ws/default_access_policy.h" |
| 6 | 6 |
| 7 #include "services/ui/ws/access_policy_delegate.h" | 7 #include "services/ui/ws/access_policy_delegate.h" |
| 8 #include "services/ui/ws/server_window.h" | 8 #include "services/ui/ws/server_window.h" |
| 9 | 9 |
| 10 namespace ui { | 10 namespace ui { |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 return (WasCreatedByThisClient(window) && | 149 return (WasCreatedByThisClient(window) && |
| 150 !delegate_->IsWindowRootOfAnotherTreeForAccessPolicy(window)) || | 150 !delegate_->IsWindowRootOfAnotherTreeForAccessPolicy(window)) || |
| 151 delegate_->HasRootForAccessPolicy(window); | 151 delegate_->HasRootForAccessPolicy(window); |
| 152 } | 152 } |
| 153 | 153 |
| 154 bool DefaultAccessPolicy::CanSetAcceptEvents(const ServerWindow* window) const { | 154 bool DefaultAccessPolicy::CanSetAcceptEvents(const ServerWindow* window) const { |
| 155 return WasCreatedByThisClient(window) || | 155 return WasCreatedByThisClient(window) || |
| 156 delegate_->HasRootForAccessPolicy(window); | 156 delegate_->HasRootForAccessPolicy(window); |
| 157 } | 157 } |
| 158 | 158 |
| 159 bool DefaultAccessPolicy::CanStackAbove(const ServerWindow* above, |
| 160 const ServerWindow* below) const { |
| 161 return delegate_->HasRootForAccessPolicy(above) && |
| 162 delegate_->IsWindowCreatedByWindowManager(above) && |
| 163 delegate_->HasRootForAccessPolicy(below) && |
| 164 delegate_->IsWindowCreatedByWindowManager(below); |
| 165 } |
| 166 |
| 159 bool DefaultAccessPolicy::CanStackAtTop(const ServerWindow* window) const { | 167 bool DefaultAccessPolicy::CanStackAtTop(const ServerWindow* window) const { |
| 160 return delegate_->HasRootForAccessPolicy(window) && | 168 return delegate_->HasRootForAccessPolicy(window) && |
| 161 delegate_->IsWindowCreatedByWindowManager(window); | 169 delegate_->IsWindowCreatedByWindowManager(window); |
| 162 } | 170 } |
| 163 | 171 |
| 164 bool DefaultAccessPolicy::CanSetCursorProperties( | 172 bool DefaultAccessPolicy::CanSetCursorProperties( |
| 165 const ServerWindow* window) const { | 173 const ServerWindow* window) const { |
| 166 return WasCreatedByThisClient(window) || | 174 return WasCreatedByThisClient(window) || |
| 167 delegate_->HasRootForAccessPolicy(window); | 175 delegate_->HasRootForAccessPolicy(window); |
| 168 } | 176 } |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 bool DefaultAccessPolicy::IsValidIdForNewWindow( | 225 bool DefaultAccessPolicy::IsValidIdForNewWindow( |
| 218 const ClientWindowId& id) const { | 226 const ClientWindowId& id) const { |
| 219 // Clients using DefaultAccessPolicy only see windows they have created (for | 227 // Clients using DefaultAccessPolicy only see windows they have created (for |
| 220 // the embed point they choose the id), so it's ok for clients to use whatever | 228 // the embed point they choose the id), so it's ok for clients to use whatever |
| 221 // id they want. | 229 // id they want. |
| 222 return true; | 230 return true; |
| 223 } | 231 } |
| 224 | 232 |
| 225 } // namespace ws | 233 } // namespace ws |
| 226 } // namespace ui | 234 } // namespace ui |
| OLD | NEW |