| 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/window_manager_access_policy.h" | 5 #include "services/ui/ws/window_manager_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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 // The WindowManager can change the visibility of the WindowManager root. | 79 // The WindowManager can change the visibility of the WindowManager root. |
| 80 const ServerWindow* root = window->GetRoot(); | 80 const ServerWindow* root = window->GetRoot(); |
| 81 return root && window->parent() == root; | 81 return root && window->parent() == root; |
| 82 } | 82 } |
| 83 | 83 |
| 84 bool WindowManagerAccessPolicy::CanChangeWindowOpacity( | 84 bool WindowManagerAccessPolicy::CanChangeWindowOpacity( |
| 85 const ServerWindow* window) const { | 85 const ServerWindow* window) const { |
| 86 return WasCreatedByThisClient(window); | 86 return WasCreatedByThisClient(window); |
| 87 } | 87 } |
| 88 | 88 |
| 89 bool WindowManagerAccessPolicy::CanSetWindowSurface( | 89 bool WindowManagerAccessPolicy::CanSetWindowCompositorFrameSink( |
| 90 const ServerWindow* window, | 90 const ServerWindow* window, |
| 91 ui::mojom::SurfaceType surface_type) const { | 91 ui::mojom::CompositorFrameSinkType compositor_frame_sink_type) const { |
| 92 // Allow the window manager to always provide the underlay. This is important | 92 // Allow the window manager to always provide the underlay. This is important |
| 93 // when the window manager is asked to paint the title area to windows it did | 93 // when the window manager is asked to paint the title area to windows it did |
| 94 // not create. | 94 // not create. |
| 95 if (surface_type == mojom::SurfaceType::UNDERLAY) | 95 if (compositor_frame_sink_type == mojom::CompositorFrameSinkType::UNDERLAY) |
| 96 return true; | 96 return true; |
| 97 | 97 |
| 98 if (delegate_->IsWindowRootOfAnotherTreeForAccessPolicy(window)) | 98 if (delegate_->IsWindowRootOfAnotherTreeForAccessPolicy(window)) |
| 99 return false; | 99 return false; |
| 100 | 100 |
| 101 return WasCreatedByThisClient(window) || | 101 return WasCreatedByThisClient(window) || |
| 102 (delegate_->HasRootForAccessPolicy(window)); | 102 (delegate_->HasRootForAccessPolicy(window)); |
| 103 } | 103 } |
| 104 | 104 |
| 105 bool WindowManagerAccessPolicy::CanSetWindowBounds( | 105 bool WindowManagerAccessPolicy::CanSetWindowBounds( |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 return WindowIdFromTransportId(id.id).client_id == client_id_; | 201 return WindowIdFromTransportId(id.id).client_id == client_id_; |
| 202 } | 202 } |
| 203 | 203 |
| 204 bool WindowManagerAccessPolicy::WasCreatedByThisClient( | 204 bool WindowManagerAccessPolicy::WasCreatedByThisClient( |
| 205 const ServerWindow* window) const { | 205 const ServerWindow* window) const { |
| 206 return window->id().client_id == client_id_; | 206 return window->id().client_id == client_id_; |
| 207 } | 207 } |
| 208 | 208 |
| 209 } // namespace ws | 209 } // namespace ws |
| 210 } // namespace ui | 210 } // namespace ui |
| OLD | NEW |