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

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

Issue 2633233003: aura-mus: Implement stacking in DesktopWindowTreeHostMus. (Closed)
Patch Set: Add access policy for CanStackAtTop. Created 3 years, 11 months 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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 return (WasCreatedByThisClient(window) && 149 return (WasCreatedByThisClient(window) &&
150 !delegate_->IsWindowRootOfAnotherTreeForAccessPolicy(window)) || 150 !delegate_->IsWindowRootOfAnotherTreeForAccessPolicy(window)) ||
151 delegate_->HasRootForAccessPolicy(window); 151 delegate_->HasRootForAccessPolicy(window);
152 } 152 }
153 153
154 bool DefaultAccessPolicy::CanSetAcceptEvents(const ServerWindow* window) const { 154 bool DefaultAccessPolicy::CanSetAcceptEvents(const ServerWindow* window) const {
155 return WasCreatedByThisClient(window) || 155 return WasCreatedByThisClient(window) ||
156 delegate_->HasRootForAccessPolicy(window); 156 delegate_->HasRootForAccessPolicy(window);
157 } 157 }
158 158
159 bool DefaultAccessPolicy::CanStackAtTop(const ServerWindow* window) const {
160 return delegate_->HasRootForAccessPolicy(window);
sky 2017/01/20 16:36:10 Can you also add a function to the delegate that c
Elliot Glaysher 2017/01/20 22:31:02 Done.
161 }
162
159 bool DefaultAccessPolicy::CanSetCursorProperties( 163 bool DefaultAccessPolicy::CanSetCursorProperties(
160 const ServerWindow* window) const { 164 const ServerWindow* window) const {
161 return WasCreatedByThisClient(window) || 165 return WasCreatedByThisClient(window) ||
162 delegate_->HasRootForAccessPolicy(window); 166 delegate_->HasRootForAccessPolicy(window);
163 } 167 }
164 168
165 bool DefaultAccessPolicy::CanInitiateDragLoop( 169 bool DefaultAccessPolicy::CanInitiateDragLoop(
166 const ServerWindow* window) const { 170 const ServerWindow* window) const {
167 return WasCreatedByThisClient(window) || 171 return WasCreatedByThisClient(window) ||
168 delegate_->HasRootForAccessPolicy(window); 172 delegate_->HasRootForAccessPolicy(window);
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 bool DefaultAccessPolicy::IsValidIdForNewWindow( 216 bool DefaultAccessPolicy::IsValidIdForNewWindow(
213 const ClientWindowId& id) const { 217 const ClientWindowId& id) const {
214 // Clients using DefaultAccessPolicy only see windows they have created (for 218 // Clients using DefaultAccessPolicy only see windows they have created (for
215 // 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
216 // id they want. 220 // id they want.
217 return true; 221 return true;
218 } 222 }
219 223
220 } // namespace ws 224 } // namespace ws
221 } // namespace ui 225 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698