| 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 "services/ui/ws/window_manager_access_policy.h" | 5 #include "services/ui/ws/window_manager_access_policy.h" |
| 6 | 6 |
| 7 #include "services/ui/ws/access_policy_delegate.h" | 7 #include "services/ui/ws/access_policy_delegate.h" |
| 8 #include "services/ui/ws/server_window.h" | 8 #include "services/ui/ws/server_window.h" |
| 9 | 9 |
| 10 namespace ui { | 10 namespace ui { |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 return WasCreatedByThisClient(window) || | 131 return WasCreatedByThisClient(window) || |
| 132 delegate_->HasRootForAccessPolicy(window); | 132 delegate_->HasRootForAccessPolicy(window); |
| 133 } | 133 } |
| 134 | 134 |
| 135 bool WindowManagerAccessPolicy::CanSetHitTestMask( | 135 bool WindowManagerAccessPolicy::CanSetHitTestMask( |
| 136 const ServerWindow* window) const { | 136 const ServerWindow* window) const { |
| 137 return WasCreatedByThisClient(window) || | 137 return WasCreatedByThisClient(window) || |
| 138 delegate_->HasRootForAccessPolicy(window); | 138 delegate_->HasRootForAccessPolicy(window); |
| 139 } | 139 } |
| 140 | 140 |
| 141 bool WindowManagerAccessPolicy::CanSetAcceptDrops( |
| 142 const ServerWindow* window) const { |
| 143 return true; |
| 144 } |
| 145 |
| 141 bool WindowManagerAccessPolicy::CanSetAcceptEvents( | 146 bool WindowManagerAccessPolicy::CanSetAcceptEvents( |
| 142 const ServerWindow* window) const { | 147 const ServerWindow* window) const { |
| 143 return WasCreatedByThisClient(window) || | 148 return WasCreatedByThisClient(window) || |
| 144 delegate_->HasRootForAccessPolicy(window); | 149 delegate_->HasRootForAccessPolicy(window); |
| 145 } | 150 } |
| 146 | 151 |
| 147 bool WindowManagerAccessPolicy::CanSetCursorProperties( | 152 bool WindowManagerAccessPolicy::CanSetCursorProperties( |
| 148 const ServerWindow* window) const { | 153 const ServerWindow* window) const { |
| 149 return WasCreatedByThisClient(window) || | 154 return WasCreatedByThisClient(window) || |
| 150 delegate_->HasRootForAccessPolicy(window); | 155 delegate_->HasRootForAccessPolicy(window); |
| 151 } | 156 } |
| 152 | 157 |
| 158 bool WindowManagerAccessPolicy::CanInitiateDragLoop( |
| 159 const ServerWindow* window) const { |
| 160 return WasCreatedByThisClient(window) || |
| 161 delegate_->HasRootForAccessPolicy(window); |
| 162 } |
| 163 |
| 153 bool WindowManagerAccessPolicy::CanInitiateMoveLoop( | 164 bool WindowManagerAccessPolicy::CanInitiateMoveLoop( |
| 154 const ServerWindow* window) const { | 165 const ServerWindow* window) const { |
| 155 return false; | 166 return false; |
| 156 } | 167 } |
| 157 | 168 |
| 158 bool WindowManagerAccessPolicy::ShouldNotifyOnHierarchyChange( | 169 bool WindowManagerAccessPolicy::ShouldNotifyOnHierarchyChange( |
| 159 const ServerWindow* window, | 170 const ServerWindow* window, |
| 160 const ServerWindow** new_parent, | 171 const ServerWindow** new_parent, |
| 161 const ServerWindow** old_parent) const { | 172 const ServerWindow** old_parent) const { |
| 162 // Notify if we've already told the window manager about the window, or if | 173 // Notify if we've already told the window manager about the window, or if |
| (...skipping 27 matching lines...) Expand all Loading... |
| 190 return WindowIdFromTransportId(id.id).client_id == client_id_; | 201 return WindowIdFromTransportId(id.id).client_id == client_id_; |
| 191 } | 202 } |
| 192 | 203 |
| 193 bool WindowManagerAccessPolicy::WasCreatedByThisClient( | 204 bool WindowManagerAccessPolicy::WasCreatedByThisClient( |
| 194 const ServerWindow* window) const { | 205 const ServerWindow* window) const { |
| 195 return window->id().client_id == client_id_; | 206 return window->id().client_id == client_id_; |
| 196 } | 207 } |
| 197 | 208 |
| 198 } // namespace ws | 209 } // namespace ws |
| 199 } // namespace ui | 210 } // namespace ui |
| OLD | NEW |