Chromium Code Reviews| 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 MOJO_SERVICES_VIEW_MANAGER_DEFAULT_ACCESS_POLICY_H_ | |
| 6 #define MOJO_SERVICES_VIEW_MANAGER_DEFAULT_ACCESS_POLICY_H_ | |
| 7 | |
| 8 #include "base/basictypes.h" | |
| 9 #include "mojo/services/view_manager/access_policy.h" | |
| 10 | |
| 11 namespace mojo { | |
| 12 namespace service { | |
| 13 | |
| 14 class AccessPolicyDelegate; | |
| 15 | |
| 16 // AccessPolicy for all connections, except the window manager. | |
| 17 class DefaultAccessPolicy : public AccessPolicy { | |
| 18 public: | |
| 19 DefaultAccessPolicy(ConnectionSpecificId connection_id, | |
| 20 AccessPolicyDelegate* delegate); | |
| 21 virtual ~DefaultAccessPolicy(); | |
| 22 | |
| 23 // AccessPolicy: | |
| 24 virtual bool CanRemoveNodeFromParent(const Node* node) const OVERRIDE; | |
| 25 virtual bool CanAddNode(const Node* parent, const Node* child) const OVERRIDE; | |
| 26 virtual bool CanReorderNode(const Node* node, | |
| 27 const Node* relative_node, | |
| 28 OrderDirection direction) const OVERRIDE; | |
| 29 virtual bool CanDeleteNode(const Node* node) const OVERRIDE; | |
| 30 virtual bool CanDeleteView(const View* view) const OVERRIDE; | |
| 31 virtual bool CanSetView(const Node* node, const View* view) const OVERRIDE; | |
| 32 virtual bool CanSetFocus(const Node* node) const OVERRIDE; | |
| 33 virtual bool CanGetNodeTree(const Node* node) const OVERRIDE; | |
| 34 virtual bool CanDescendIntoNodeForNodeTree(const Node* node) const OVERRIDE; | |
| 35 virtual bool CanEmbed(const Node* node) const OVERRIDE; | |
| 36 virtual bool CanChangeNodeVisibility(const Node* node) const OVERRIDE; | |
| 37 virtual bool CanSetViewContents(const View* view) const OVERRIDE; | |
| 38 virtual bool CanSetNodeBounds(const Node* node) const OVERRIDE; | |
| 39 virtual bool ShouldNotifyOnHierarchyChange( | |
| 40 const Node* node, | |
| 41 const Node** new_parent, | |
| 42 const Node** old_parent) const OVERRIDE; | |
| 43 virtual Id GetViewIdToSend(const Node* node, const View* view) const OVERRIDE; | |
| 44 virtual bool ShouldSendViewDeleted(const ViewId& view_id) const OVERRIDE; | |
| 45 | |
| 46 private: | |
| 47 bool IsNodeInRoots(const Node* node) const; | |
| 48 bool IsNodeFromThisConnection(const Node* node) const; | |
|
Ben Goodger (Google)
2014/07/25 20:51:46
"From" feels weak here. "Owned" or "CreatedBy" wou
sky
2014/07/25 21:10:46
Done.
| |
| 49 | |
|
Ben Goodger (Google)
2014/07/25 20:51:46
Aside, is it the case that the only nodes visible
sky
2014/07/25 21:10:46
For everyone but the window manager, yes.
| |
| 50 const ConnectionSpecificId connection_id_; | |
| 51 AccessPolicyDelegate* delegate_; | |
| 52 | |
| 53 DISALLOW_COPY_AND_ASSIGN(DefaultAccessPolicy); | |
| 54 }; | |
| 55 | |
| 56 } // namespace service | |
| 57 } // namespace mojo | |
| 58 | |
| 59 #endif // MOJO_SERVICES_VIEW_MANAGER_DEFAULT_ACCESS_POLICY_H_ | |
| OLD | NEW |