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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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::CanSetWindowCompositorFrameSink( | 89 bool WindowManagerAccessPolicy::CanSetWindowCompositorFrameSink( |
90 const ServerWindow* window, | 90 const ServerWindow* window) const { |
91 ui::mojom::CompositorFrameSinkType compositor_frame_sink_type) const { | |
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 | |
94 // not create. | |
95 if (compositor_frame_sink_type == mojom::CompositorFrameSinkType::UNDERLAY) | |
96 return true; | |
97 | |
98 if (delegate_->IsWindowRootOfAnotherTreeForAccessPolicy(window)) | 91 if (delegate_->IsWindowRootOfAnotherTreeForAccessPolicy(window)) |
99 return false; | 92 return false; |
100 | 93 |
101 return WasCreatedByThisClient(window) || | 94 return WasCreatedByThisClient(window) || |
102 (delegate_->HasRootForAccessPolicy(window)); | 95 (delegate_->HasRootForAccessPolicy(window)); |
103 } | 96 } |
104 | 97 |
105 bool WindowManagerAccessPolicy::CanSetWindowBounds( | 98 bool WindowManagerAccessPolicy::CanSetWindowBounds( |
106 const ServerWindow* window) const { | 99 const ServerWindow* window) const { |
107 return WasCreatedByThisClient(window); | 100 return WasCreatedByThisClient(window); |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 return WindowIdFromTransportId(id.id).client_id == client_id_; | 194 return WindowIdFromTransportId(id.id).client_id == client_id_; |
202 } | 195 } |
203 | 196 |
204 bool WindowManagerAccessPolicy::WasCreatedByThisClient( | 197 bool WindowManagerAccessPolicy::WasCreatedByThisClient( |
205 const ServerWindow* window) const { | 198 const ServerWindow* window) const { |
206 return window->id().client_id == client_id_; | 199 return window->id().client_id == client_id_; |
207 } | 200 } |
208 | 201 |
209 } // namespace ws | 202 } // namespace ws |
210 } // namespace ui | 203 } // namespace ui |
OLD | NEW |