| 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 #ifndef COMPONENTS_MUS_WS_DEFAULT_ACCESS_POLICY_H_ | 5 #ifndef COMPONENTS_MUS_WS_DEFAULT_ACCESS_POLICY_H_ |
| 6 #define COMPONENTS_MUS_WS_DEFAULT_ACCESS_POLICY_H_ | 6 #define COMPONENTS_MUS_WS_DEFAULT_ACCESS_POLICY_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "components/mus/ws/access_policy.h" | 11 #include "components/mus/ws/access_policy.h" |
| 12 | 12 |
| 13 namespace mus { | 13 namespace mus { |
| 14 namespace ws { | 14 namespace ws { |
| 15 | 15 |
| 16 class AccessPolicyDelegate; | 16 class AccessPolicyDelegate; |
| 17 | 17 |
| 18 // AccessPolicy for all connections, except the window manager. | 18 // AccessPolicy for all connections, except the window manager. |
| 19 class DefaultAccessPolicy : public AccessPolicy { | 19 class DefaultAccessPolicy : public AccessPolicy { |
| 20 public: | 20 public: |
| 21 DefaultAccessPolicy(ConnectionSpecificId connection_id, | 21 DefaultAccessPolicy(); |
| 22 AccessPolicyDelegate* delegate); | |
| 23 ~DefaultAccessPolicy() override; | 22 ~DefaultAccessPolicy() override; |
| 24 | 23 |
| 25 // AccessPolicy: | 24 // AccessPolicy: |
| 25 void Init(ConnectionSpecificId connection_id, |
| 26 AccessPolicyDelegate* delegate) override; |
| 26 bool CanRemoveWindowFromParent(const ServerWindow* window) const override; | 27 bool CanRemoveWindowFromParent(const ServerWindow* window) const override; |
| 27 bool CanAddWindow(const ServerWindow* parent, | 28 bool CanAddWindow(const ServerWindow* parent, |
| 28 const ServerWindow* child) const override; | 29 const ServerWindow* child) const override; |
| 29 bool CanAddTransientWindow(const ServerWindow* parent, | 30 bool CanAddTransientWindow(const ServerWindow* parent, |
| 30 const ServerWindow* child) const override; | 31 const ServerWindow* child) const override; |
| 31 bool CanRemoveTransientWindowFromParent( | 32 bool CanRemoveTransientWindowFromParent( |
| 32 const ServerWindow* window) const override; | 33 const ServerWindow* window) const override; |
| 33 bool CanSetModal(const ServerWindow* window) const override; | 34 bool CanSetModal(const ServerWindow* window) const override; |
| 34 bool CanReorderWindow(const ServerWindow* window, | 35 bool CanReorderWindow(const ServerWindow* window, |
| 35 const ServerWindow* relative_window, | 36 const ServerWindow* relative_window, |
| (...skipping 18 matching lines...) Expand all Loading... |
| 54 const ServerWindow** new_parent, | 55 const ServerWindow** new_parent, |
| 55 const ServerWindow** old_parent) const override; | 56 const ServerWindow** old_parent) const override; |
| 56 const ServerWindow* GetWindowForFocusChange( | 57 const ServerWindow* GetWindowForFocusChange( |
| 57 const ServerWindow* focused) override; | 58 const ServerWindow* focused) override; |
| 58 bool CanSetWindowManager() const override; | 59 bool CanSetWindowManager() const override; |
| 59 bool IsValidIdForNewWindow(const ClientWindowId& id) const override; | 60 bool IsValidIdForNewWindow(const ClientWindowId& id) const override; |
| 60 | 61 |
| 61 private: | 62 private: |
| 62 bool WasCreatedByThisConnection(const ServerWindow* window) const; | 63 bool WasCreatedByThisConnection(const ServerWindow* window) const; |
| 63 | 64 |
| 64 const ConnectionSpecificId connection_id_; | 65 ConnectionSpecificId connection_id_ = 0u; |
| 65 AccessPolicyDelegate* delegate_; | 66 AccessPolicyDelegate* delegate_ = nullptr; |
| 66 | 67 |
| 67 DISALLOW_COPY_AND_ASSIGN(DefaultAccessPolicy); | 68 DISALLOW_COPY_AND_ASSIGN(DefaultAccessPolicy); |
| 68 }; | 69 }; |
| 69 | 70 |
| 70 } // namespace ws | 71 } // namespace ws |
| 71 } // namespace mus | 72 } // namespace mus |
| 72 | 73 |
| 73 #endif // COMPONENTS_MUS_WS_DEFAULT_ACCESS_POLICY_H_ | 74 #endif // COMPONENTS_MUS_WS_DEFAULT_ACCESS_POLICY_H_ |
| OLD | NEW |