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/window_manager_access_policy.h" | 5 #include "components/mus/ws/window_manager_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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 bool WindowManagerAccessPolicy::CanChangeWindowVisibility( | 72 bool WindowManagerAccessPolicy::CanChangeWindowVisibility( |
73 const ServerWindow* window) const { | 73 const ServerWindow* window) const { |
74 // The WindowManager can change the visibility of the root too. | 74 // The WindowManager can change the visibility of the root too. |
75 return window->id().connection_id == connection_id_ || | 75 return window->id().connection_id == connection_id_ || |
76 (window->GetRoot() == window); | 76 (window->GetRoot() == window); |
77 } | 77 } |
78 | 78 |
79 bool WindowManagerAccessPolicy::CanSetWindowSurface( | 79 bool WindowManagerAccessPolicy::CanSetWindowSurface( |
80 const ServerWindow* window, | 80 const ServerWindow* window, |
81 mus::mojom::SurfaceType surface_type) const { | 81 mus::mojom::SurfaceType surface_type) const { |
82 if (surface_type == mojom::SURFACE_TYPE_UNDERLAY) | 82 if (surface_type == mojom::SurfaceType::UNDERLAY) |
83 return window->id().connection_id == connection_id_; | 83 return window->id().connection_id == connection_id_; |
84 | 84 |
85 if (delegate_->IsWindowRootOfAnotherConnectionForAccessPolicy(window)) | 85 if (delegate_->IsWindowRootOfAnotherConnectionForAccessPolicy(window)) |
86 return false; | 86 return false; |
87 return window->id().connection_id == connection_id_ || | 87 return window->id().connection_id == connection_id_ || |
88 (delegate_->HasRootForAccessPolicy(window)); | 88 (delegate_->HasRootForAccessPolicy(window)); |
89 } | 89 } |
90 | 90 |
91 bool WindowManagerAccessPolicy::CanSetWindowBounds( | 91 bool WindowManagerAccessPolicy::CanSetWindowBounds( |
92 const ServerWindow* window) const { | 92 const ServerWindow* window) const { |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 } | 141 } |
142 | 142 |
143 bool WindowManagerAccessPolicy::IsWindowKnown( | 143 bool WindowManagerAccessPolicy::IsWindowKnown( |
144 const ServerWindow* window) const { | 144 const ServerWindow* window) const { |
145 return delegate_->IsWindowKnownForAccessPolicy(window); | 145 return delegate_->IsWindowKnownForAccessPolicy(window); |
146 } | 146 } |
147 | 147 |
148 } // namespace ws | 148 } // namespace ws |
149 | 149 |
150 } // namespace mus | 150 } // namespace mus |
OLD | NEW |