| 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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 return WasCreatedByThisConnection(window) || | 122 return WasCreatedByThisConnection(window) || |
| 123 delegate_->HasRootForAccessPolicy(window); | 123 delegate_->HasRootForAccessPolicy(window); |
| 124 } | 124 } |
| 125 | 125 |
| 126 bool DefaultAccessPolicy::CanSetCapture(const ServerWindow* window) const { | 126 bool DefaultAccessPolicy::CanSetCapture(const ServerWindow* window) const { |
| 127 return WasCreatedByThisConnection(window) || | 127 return WasCreatedByThisConnection(window) || |
| 128 delegate_->HasRootForAccessPolicy(window); | 128 delegate_->HasRootForAccessPolicy(window); |
| 129 } | 129 } |
| 130 | 130 |
| 131 bool DefaultAccessPolicy::CanSetFocus(const ServerWindow* window) const { | 131 bool DefaultAccessPolicy::CanSetFocus(const ServerWindow* window) const { |
| 132 return WasCreatedByThisConnection(window) || | 132 return !window || WasCreatedByThisConnection(window) || |
| 133 delegate_->HasRootForAccessPolicy(window); | 133 delegate_->HasRootForAccessPolicy(window); |
| 134 } | 134 } |
| 135 | 135 |
| 136 bool DefaultAccessPolicy::CanSetClientArea(const ServerWindow* window) const { | 136 bool DefaultAccessPolicy::CanSetClientArea(const ServerWindow* window) const { |
| 137 return WasCreatedByThisConnection(window) || | 137 return WasCreatedByThisConnection(window) || |
| 138 delegate_->HasRootForAccessPolicy(window); | 138 delegate_->HasRootForAccessPolicy(window); |
| 139 } | 139 } |
| 140 | 140 |
| 141 bool DefaultAccessPolicy::CanSetCursorProperties( | 141 bool DefaultAccessPolicy::CanSetCursorProperties( |
| 142 const ServerWindow* window) const { | 142 const ServerWindow* window) const { |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 bool DefaultAccessPolicy::IsValidIdForNewWindow( | 183 bool DefaultAccessPolicy::IsValidIdForNewWindow( |
| 184 const ClientWindowId& id) const { | 184 const ClientWindowId& id) const { |
| 185 // Clients using DefaultAccessPolicy only see windows they have created (for | 185 // Clients using DefaultAccessPolicy only see windows they have created (for |
| 186 // the embed point they choose the id), so it's ok for clients to use whatever | 186 // the embed point they choose the id), so it's ok for clients to use whatever |
| 187 // id they want. | 187 // id they want. |
| 188 return true; | 188 return true; |
| 189 } | 189 } |
| 190 | 190 |
| 191 } // namespace ws | 191 } // namespace ws |
| 192 } // namespace mus | 192 } // namespace mus |
| OLD | NEW |