OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef COMPONENTS_MUS_WS_WINDOW_MANAGER_ACCESS_POLICY_H_ | |
6 #define COMPONENTS_MUS_WS_WINDOW_MANAGER_ACCESS_POLICY_H_ | |
7 | |
8 #include <stdint.h> | |
9 | |
10 #include "base/macros.h" | |
11 #include "components/mus/ws/access_policy.h" | |
12 | |
13 namespace mus { | |
14 namespace ws { | |
15 | |
16 class AccessPolicyDelegate; | |
17 | |
18 class WindowManagerAccessPolicy : public AccessPolicy { | |
19 public: | |
20 WindowManagerAccessPolicy(); | |
21 ~WindowManagerAccessPolicy() override; | |
22 | |
23 // AccessPolicy: | |
24 void Init(ClientSpecificId client_id, | |
25 AccessPolicyDelegate* delegate) override; | |
26 bool CanRemoveWindowFromParent(const ServerWindow* window) const override; | |
27 bool CanAddWindow(const ServerWindow* parent, | |
28 const ServerWindow* child) const override; | |
29 bool CanAddTransientWindow(const ServerWindow* parent, | |
30 const ServerWindow* child) const override; | |
31 bool CanRemoveTransientWindowFromParent( | |
32 const ServerWindow* window) const override; | |
33 bool CanSetModal(const ServerWindow* window) const override; | |
34 bool CanReorderWindow(const ServerWindow* window, | |
35 const ServerWindow* relative_window, | |
36 mojom::OrderDirection direction) const override; | |
37 bool CanDeleteWindow(const ServerWindow* window) const override; | |
38 bool CanGetWindowTree(const ServerWindow* window) const override; | |
39 bool CanDescendIntoWindowForWindowTree( | |
40 const ServerWindow* window) const override; | |
41 bool CanEmbed(const ServerWindow* window) const override; | |
42 bool CanChangeWindowVisibility(const ServerWindow* window) const override; | |
43 bool CanChangeWindowOpacity(const ServerWindow* window) const override; | |
44 bool CanSetWindowSurface(const ServerWindow* window, | |
45 mus::mojom::SurfaceType surface_type) const override; | |
46 bool CanSetWindowBounds(const ServerWindow* window) const override; | |
47 bool CanSetWindowProperties(const ServerWindow* window) const override; | |
48 bool CanSetWindowTextInputState(const ServerWindow* window) const override; | |
49 bool CanSetCapture(const ServerWindow* window) const override; | |
50 bool CanSetFocus(const ServerWindow* window) const override; | |
51 bool CanSetClientArea(const ServerWindow* window) const override; | |
52 bool CanSetHitTestMask(const ServerWindow* window) const override; | |
53 bool CanSetCursorProperties(const ServerWindow* window) const override; | |
54 bool ShouldNotifyOnHierarchyChange( | |
55 const ServerWindow* window, | |
56 const ServerWindow** new_parent, | |
57 const ServerWindow** old_parent) const override; | |
58 const ServerWindow* GetWindowForFocusChange( | |
59 const ServerWindow* focused) override; | |
60 bool CanSetWindowManager() const override; | |
61 bool IsValidIdForNewWindow(const ClientWindowId& id) const override; | |
62 | |
63 private: | |
64 bool IsWindowKnown(const ServerWindow* window) const; | |
65 bool WasCreatedByThisClient(const ServerWindow* window) const; | |
66 | |
67 ClientSpecificId client_id_ = 0u; | |
68 AccessPolicyDelegate* delegate_ = nullptr; | |
69 | |
70 DISALLOW_COPY_AND_ASSIGN(WindowManagerAccessPolicy); | |
71 }; | |
72 | |
73 } // namespace ws | |
74 } // namespace mus | |
75 | |
76 #endif // COMPONENTS_MUS_WS_WINDOW_MANAGER_ACCESS_POLICY_H_ | |
OLD | NEW |