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

Side by Side Diff: components/mus/ws/window_manager_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/window_manager_access_policy.h ('k') | components/mus/ws/window_tree.h » ('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/window_manager_access_policy.h" 5 #include "components/mus/ws/window_manager_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 // TODO(sky): document why this differs from default for each case. Maybe want 13 WindowManagerAccessPolicy::WindowManagerAccessPolicy() {}
14 // to subclass DefaultAccessPolicy.
15
16 WindowManagerAccessPolicy::WindowManagerAccessPolicy(
17 ConnectionSpecificId connection_id,
18 AccessPolicyDelegate* delegate)
19 : connection_id_(connection_id), delegate_(delegate) {}
20 14
21 WindowManagerAccessPolicy::~WindowManagerAccessPolicy() {} 15 WindowManagerAccessPolicy::~WindowManagerAccessPolicy() {}
22 16
17 void WindowManagerAccessPolicy::Init(ConnectionSpecificId connection_id,
18 AccessPolicyDelegate* delegate) {
19 connection_id_ = connection_id;
20 delegate_ = delegate;
21 }
22
23 bool WindowManagerAccessPolicy::CanRemoveWindowFromParent( 23 bool WindowManagerAccessPolicy::CanRemoveWindowFromParent(
24 const ServerWindow* window) const { 24 const ServerWindow* window) const {
25 return true; 25 return true;
26 } 26 }
27 27
28 bool WindowManagerAccessPolicy::CanAddWindow(const ServerWindow* parent, 28 bool WindowManagerAccessPolicy::CanAddWindow(const ServerWindow* parent,
29 const ServerWindow* child) const { 29 const ServerWindow* child) const {
30 return true; 30 return true;
31 } 31 }
32 32
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 const ClientWindowId& id) const { 159 const ClientWindowId& id) const {
160 // The WindowManager see windows created from other clients. If the WM doesn't 160 // The WindowManager see windows created from other clients. If the WM doesn't
161 // use the connection id when creating windows the WM could end up with two 161 // use the connection id when creating windows the WM could end up with two
162 // windows with the same id. Because of this the wm must use the same 162 // windows with the same id. Because of this the wm must use the same
163 // connection id for all windows it creates. 163 // connection id for all windows it creates.
164 return WindowIdFromTransportId(id.id).connection_id == connection_id_; 164 return WindowIdFromTransportId(id.id).connection_id == connection_id_;
165 } 165 }
166 166
167 } // namespace ws 167 } // namespace ws
168 } // namespace mus 168 } // namespace mus
OLDNEW
« no previous file with comments | « components/mus/ws/window_manager_access_policy.h ('k') | components/mus/ws/window_tree.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698