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

Side by Side Diff: components/mus/ws/default_access_policy.cc

Issue 1782123003: Makes WindowTree take the AccessPolicy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge Created 4 years, 9 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
« no previous file with comments | « components/mus/ws/default_access_policy.h ('k') | components/mus/ws/display_binding.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "components/mus/ws/default_access_policy.h" 5 #include "components/mus/ws/default_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 {
11 namespace ws { 11 namespace ws {
12 12
13 DefaultAccessPolicy::DefaultAccessPolicy(ConnectionSpecificId connection_id, 13 DefaultAccessPolicy::DefaultAccessPolicy() {}
14 AccessPolicyDelegate* delegate)
15 : connection_id_(connection_id), delegate_(delegate) {}
16 14
17 DefaultAccessPolicy::~DefaultAccessPolicy() {} 15 DefaultAccessPolicy::~DefaultAccessPolicy() {}
18 16
17 void DefaultAccessPolicy::Init(ConnectionSpecificId connection_id,
18 AccessPolicyDelegate* delegate) {
19 connection_id_ = connection_id;
20 delegate_ = delegate;
21 }
22
19 bool DefaultAccessPolicy::CanRemoveWindowFromParent( 23 bool DefaultAccessPolicy::CanRemoveWindowFromParent(
20 const ServerWindow* window) const { 24 const ServerWindow* window) const {
21 if (!WasCreatedByThisConnection(window)) 25 if (!WasCreatedByThisConnection(window))
22 return false; // Can only unparent windows we created. 26 return false; // Can only unparent windows we created.
23 27
24 return delegate_->HasRootForAccessPolicy(window->parent()) || 28 return delegate_->HasRootForAccessPolicy(window->parent()) ||
25 WasCreatedByThisConnection(window->parent()); 29 WasCreatedByThisConnection(window->parent());
26 } 30 }
27 31
28 bool DefaultAccessPolicy::CanAddWindow(const ServerWindow* parent, 32 bool DefaultAccessPolicy::CanAddWindow(const ServerWindow* parent,
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 bool DefaultAccessPolicy::IsValidIdForNewWindow( 183 bool DefaultAccessPolicy::IsValidIdForNewWindow(
180 const ClientWindowId& id) const { 184 const ClientWindowId& id) const {
181 // Clients using DefaultAccessPolicy only see windows they have created (for 185 // Clients using DefaultAccessPolicy only see windows they have created (for
182 // the embed point they choose the id), so it's ok for clients to use whatever 186 // the embed point they choose the id), so it's ok for clients to use whatever
183 // id they want. 187 // id they want.
184 return true; 188 return true;
185 } 189 }
186 190
187 } // namespace ws 191 } // namespace ws
188 } // namespace mus 192 } // namespace mus
OLDNEW
« no previous file with comments | « components/mus/ws/default_access_policy.h ('k') | components/mus/ws/display_binding.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698