| 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 { |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 bool WindowManagerAccessPolicy::CanSetFocus(const ServerWindow* window) const { | 106 bool WindowManagerAccessPolicy::CanSetFocus(const ServerWindow* window) const { |
| 107 return true; | 107 return true; |
| 108 } | 108 } |
| 109 | 109 |
| 110 bool WindowManagerAccessPolicy::CanSetClientArea( | 110 bool WindowManagerAccessPolicy::CanSetClientArea( |
| 111 const ServerWindow* window) const { | 111 const ServerWindow* window) const { |
| 112 return window->id().connection_id == connection_id_ || | 112 return window->id().connection_id == connection_id_ || |
| 113 delegate_->IsRootForAccessPolicy(window->id()); | 113 delegate_->IsRootForAccessPolicy(window->id()); |
| 114 } | 114 } |
| 115 | 115 |
| 116 bool WindowManagerAccessPolicy::CanSetCursorProperties( |
| 117 const ServerWindow* window) const { |
| 118 return window->id().connection_id == connection_id_ || |
| 119 delegate_->IsRootForAccessPolicy(window->id()); |
| 120 } |
| 121 |
| 116 bool WindowManagerAccessPolicy::ShouldNotifyOnHierarchyChange( | 122 bool WindowManagerAccessPolicy::ShouldNotifyOnHierarchyChange( |
| 117 const ServerWindow* window, | 123 const ServerWindow* window, |
| 118 const ServerWindow** new_parent, | 124 const ServerWindow** new_parent, |
| 119 const ServerWindow** old_parent) const { | 125 const ServerWindow** old_parent) const { |
| 120 // Notify if we've already told the window manager about the window, or if | 126 // Notify if we've already told the window manager about the window, or if |
| 121 // we've | 127 // we've |
| 122 // already told the window manager about the parent. The later handles the | 128 // already told the window manager about the parent. The later handles the |
| 123 // case of a window that wasn't parented to the root getting added to the | 129 // case of a window that wasn't parented to the root getting added to the |
| 124 // root. | 130 // root. |
| 125 return IsWindowKnown(window) || (*new_parent && IsWindowKnown(*new_parent)); | 131 return IsWindowKnown(window) || (*new_parent && IsWindowKnown(*new_parent)); |
| 126 } | 132 } |
| 127 | 133 |
| 128 const ServerWindow* WindowManagerAccessPolicy::GetWindowForFocusChange( | 134 const ServerWindow* WindowManagerAccessPolicy::GetWindowForFocusChange( |
| 129 const ServerWindow* focused) { | 135 const ServerWindow* focused) { |
| 130 return focused; | 136 return focused; |
| 131 } | 137 } |
| 132 | 138 |
| 133 bool WindowManagerAccessPolicy::IsWindowKnown( | 139 bool WindowManagerAccessPolicy::IsWindowKnown( |
| 134 const ServerWindow* window) const { | 140 const ServerWindow* window) const { |
| 135 return delegate_->IsWindowKnownForAccessPolicy(window); | 141 return delegate_->IsWindowKnownForAccessPolicy(window); |
| 136 } | 142 } |
| 137 | 143 |
| 138 } // namespace ws | 144 } // namespace ws |
| 139 | 145 |
| 140 } // namespace mus | 146 } // namespace mus |
| OLD | NEW |