| 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 delegate_->HasRootForAccessPolicy(window); | 93 delegate_->HasRootForAccessPolicy(window); |
| 94 } | 94 } |
| 95 | 95 |
| 96 bool DefaultAccessPolicy::CanChangeWindowOpacity( | 96 bool DefaultAccessPolicy::CanChangeWindowOpacity( |
| 97 const ServerWindow* window) const { | 97 const ServerWindow* window) const { |
| 98 return WasCreatedByThisClient(window) || | 98 return WasCreatedByThisClient(window) || |
| 99 delegate_->HasRootForAccessPolicy(window); | 99 delegate_->HasRootForAccessPolicy(window); |
| 100 } | 100 } |
| 101 | 101 |
| 102 bool DefaultAccessPolicy::CanSetWindowCompositorFrameSink( | 102 bool DefaultAccessPolicy::CanSetWindowCompositorFrameSink( |
| 103 const ServerWindow* window, | 103 const ServerWindow* window) const { |
| 104 mojom::CompositorFrameSinkType compositor_frame_sink_type) const { | |
| 105 if (compositor_frame_sink_type == mojom::CompositorFrameSinkType::UNDERLAY) | |
| 106 return WasCreatedByThisClient(window); | |
| 107 | |
| 108 // Once a window embeds another app, the embedder app is no longer able to | 104 // Once a window embeds another app, the embedder app is no longer able to |
| 109 // call SetWindowSurfaceId() - this ability is transferred to the embedded | 105 // call SetWindowSurfaceId() - this ability is transferred to the embedded |
| 110 // app. | 106 // app. |
| 111 if (delegate_->IsWindowRootOfAnotherTreeForAccessPolicy(window)) | 107 if (delegate_->IsWindowRootOfAnotherTreeForAccessPolicy(window)) |
| 112 return false; | 108 return false; |
| 113 return WasCreatedByThisClient(window) || | 109 return WasCreatedByThisClient(window) || |
| 114 delegate_->HasRootForAccessPolicy(window); | 110 delegate_->HasRootForAccessPolicy(window); |
| 115 } | 111 } |
| 116 | 112 |
| 117 bool DefaultAccessPolicy::CanSetWindowBounds(const ServerWindow* window) const { | 113 bool DefaultAccessPolicy::CanSetWindowBounds(const ServerWindow* window) const { |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 bool DefaultAccessPolicy::IsValidIdForNewWindow( | 212 bool DefaultAccessPolicy::IsValidIdForNewWindow( |
| 217 const ClientWindowId& id) const { | 213 const ClientWindowId& id) const { |
| 218 // Clients using DefaultAccessPolicy only see windows they have created (for | 214 // Clients using DefaultAccessPolicy only see windows they have created (for |
| 219 // the embed point they choose the id), so it's ok for clients to use whatever | 215 // the embed point they choose the id), so it's ok for clients to use whatever |
| 220 // id they want. | 216 // id they want. |
| 221 return true; | 217 return true; |
| 222 } | 218 } |
| 223 | 219 |
| 224 } // namespace ws | 220 } // namespace ws |
| 225 } // namespace ui | 221 } // namespace ui |
| OLD | NEW |