| 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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 return WasCreatedByThisClient(window) || | 144 return WasCreatedByThisClient(window) || |
| 145 delegate_->HasRootForAccessPolicy(window); | 145 delegate_->HasRootForAccessPolicy(window); |
| 146 } | 146 } |
| 147 | 147 |
| 148 bool DefaultAccessPolicy::CanSetAcceptDrops(const ServerWindow* window) const { | 148 bool DefaultAccessPolicy::CanSetAcceptDrops(const ServerWindow* window) const { |
| 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::CanSetEventTargetingPolicy( |
| 155 const ServerWindow* window) const { |
| 155 return WasCreatedByThisClient(window) || | 156 return WasCreatedByThisClient(window) || |
| 156 delegate_->HasRootForAccessPolicy(window); | 157 delegate_->HasRootForAccessPolicy(window); |
| 157 } | 158 } |
| 158 | 159 |
| 159 bool DefaultAccessPolicy::CanStackAbove(const ServerWindow* above, | 160 bool DefaultAccessPolicy::CanStackAbove(const ServerWindow* above, |
| 160 const ServerWindow* below) const { | 161 const ServerWindow* below) const { |
| 161 return delegate_->HasRootForAccessPolicy(above) && | 162 return delegate_->HasRootForAccessPolicy(above) && |
| 162 delegate_->IsWindowCreatedByWindowManager(above) && | 163 delegate_->IsWindowCreatedByWindowManager(above) && |
| 163 delegate_->HasRootForAccessPolicy(below) && | 164 delegate_->HasRootForAccessPolicy(below) && |
| 164 delegate_->IsWindowCreatedByWindowManager(below); | 165 delegate_->IsWindowCreatedByWindowManager(below); |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 bool DefaultAccessPolicy::IsValidIdForNewWindow( | 226 bool DefaultAccessPolicy::IsValidIdForNewWindow( |
| 226 const ClientWindowId& id) const { | 227 const ClientWindowId& id) const { |
| 227 // Clients using DefaultAccessPolicy only see windows they have created (for | 228 // Clients using DefaultAccessPolicy only see windows they have created (for |
| 228 // the embed point they choose the id), so it's ok for clients to use whatever | 229 // the embed point they choose the id), so it's ok for clients to use whatever |
| 229 // id they want. | 230 // id they want. |
| 230 return true; | 231 return true; |
| 231 } | 232 } |
| 232 | 233 |
| 233 } // namespace ws | 234 } // namespace ws |
| 234 } // namespace ui | 235 } // namespace ui |
| OLD | NEW |