| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |