Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(199)

Side by Side Diff: services/ui/ws/default_access_policy.cc

Issue 2429173005: Mus+Ash: Replace (Server)WindowSurface with (Server)WindowCompositorFrameSink (Closed)
Patch Set: ui::CompositorFrameSink => ui::WindowCompositorFrameSink Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 return WasCreatedByThisClient(window) || 92 return WasCreatedByThisClient(window) ||
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::CanSetWindowSurface( 102 bool DefaultAccessPolicy::CanSetWindowCompositorFrameSink(
103 const ServerWindow* window, 103 const ServerWindow* window,
104 mojom::SurfaceType surface_type) const { 104 mojom::CompositorFrameSinkType compositor_frame_sink_type) const {
105 if (surface_type == mojom::SurfaceType::UNDERLAY) 105 if (compositor_frame_sink_type == mojom::CompositorFrameSinkType::UNDERLAY)
106 return WasCreatedByThisClient(window); 106 return WasCreatedByThisClient(window);
107 107
108 // Once a window embeds another app, the embedder app is no longer able to 108 // Once a window embeds another app, the embedder app is no longer able to
109 // call SetWindowSurfaceId() - this ability is transferred to the embedded 109 // call SetWindowSurfaceId() - this ability is transferred to the embedded
110 // app. 110 // app.
111 if (delegate_->IsWindowRootOfAnotherTreeForAccessPolicy(window)) 111 if (delegate_->IsWindowRootOfAnotherTreeForAccessPolicy(window))
112 return false; 112 return false;
113 return WasCreatedByThisClient(window) || 113 return WasCreatedByThisClient(window) ||
114 delegate_->HasRootForAccessPolicy(window); 114 delegate_->HasRootForAccessPolicy(window);
115 } 115 }
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 bool DefaultAccessPolicy::IsValidIdForNewWindow( 216 bool DefaultAccessPolicy::IsValidIdForNewWindow(
217 const ClientWindowId& id) const { 217 const ClientWindowId& id) const {
218 // Clients using DefaultAccessPolicy only see windows they have created (for 218 // 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 219 // the embed point they choose the id), so it's ok for clients to use whatever
220 // id they want. 220 // id they want.
221 return true; 221 return true;
222 } 222 }
223 223
224 } // namespace ws 224 } // namespace ws
225 } // namespace ui 225 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698