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

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

Issue 1805023003: Update DefaultAccessPolicy Hierarchy Notifications (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 | « no previous file | components/mus/ws/window_tree_client_unittest.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 {
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 bool DefaultAccessPolicy::CanSetCursorProperties( 141 bool DefaultAccessPolicy::CanSetCursorProperties(
142 const ServerWindow* window) const { 142 const ServerWindow* window) const {
143 return WasCreatedByThisConnection(window) || 143 return WasCreatedByThisConnection(window) ||
144 delegate_->HasRootForAccessPolicy(window); 144 delegate_->HasRootForAccessPolicy(window);
145 } 145 }
146 146
147 bool DefaultAccessPolicy::ShouldNotifyOnHierarchyChange( 147 bool DefaultAccessPolicy::ShouldNotifyOnHierarchyChange(
148 const ServerWindow* window, 148 const ServerWindow* window,
149 const ServerWindow** new_parent, 149 const ServerWindow** new_parent,
150 const ServerWindow** old_parent) const { 150 const ServerWindow** old_parent) const {
151 if (!WasCreatedByThisConnection(window) && !*new_parent && !*old_parent) 151 if (!WasCreatedByThisConnection(window))
152 return false; 152 return false;
153 153
154 if (*new_parent && !WasCreatedByThisConnection(*new_parent) && 154 if (*new_parent && !WasCreatedByThisConnection(*new_parent) &&
155 !delegate_->HasRootForAccessPolicy((*new_parent))) { 155 !delegate_->HasRootForAccessPolicy((*new_parent))) {
156 *new_parent = nullptr; 156 *new_parent = nullptr;
157 } 157 }
158 158
159 if (*old_parent && !WasCreatedByThisConnection(*old_parent) && 159 if (*old_parent && !WasCreatedByThisConnection(*old_parent) &&
160 !delegate_->HasRootForAccessPolicy((*old_parent))) { 160 !delegate_->HasRootForAccessPolicy((*old_parent))) {
161 *old_parent = nullptr; 161 *old_parent = nullptr;
(...skipping 21 matching lines...) Expand all
183 bool DefaultAccessPolicy::IsValidIdForNewWindow( 183 bool DefaultAccessPolicy::IsValidIdForNewWindow(
184 const ClientWindowId& id) const { 184 const ClientWindowId& id) const {
185 // Clients using DefaultAccessPolicy only see windows they have created (for 185 // Clients using DefaultAccessPolicy only see windows they have created (for
186 // 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
187 // id they want. 187 // id they want.
188 return true; 188 return true;
189 } 189 }
190 190
191 } // namespace ws 191 } // namespace ws
192 } // namespace mus 192 } // namespace mus
OLDNEW
« no previous file with comments | « no previous file | components/mus/ws/window_tree_client_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698