Index: mojo/services/view_manager/access_policy_delegate.h |
diff --git a/mojo/services/view_manager/access_policy_delegate.h b/mojo/services/view_manager/access_policy_delegate.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..ec54512ef10b708cb8a53d3b09f58db893748054 |
--- /dev/null |
+++ b/mojo/services/view_manager/access_policy_delegate.h |
@@ -0,0 +1,39 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef MOJO_SERVICES_VIEW_MANAGER_ACCESS_POLICY_DELEGATE_H_ |
+#define MOJO_SERVICES_VIEW_MANAGER_ACCESS_POLICY_DELEGATE_H_ |
+ |
+#include <vector> |
+ |
+#include "base/containers/hash_tables.h" |
+#include "mojo/services/view_manager/ids.h" |
+ |
+namespace mojo { |
+namespace service { |
+ |
+class Node; |
+ |
+// Delegate used by the AccessPolicy implementations to get state. |
+class AccessPolicyDelegate { |
+ public: |
+ // Returns the ids of the roots nodes for this connection. That is, this is |
+ // the set of nodes the connection was embedded at. |
+ virtual const base::hash_set<Id>& GetRootsForAccessPolicy() const = 0; |
+ |
+ // Returns true if |node| has been exposed to the client. |
+ virtual bool IsNodeKnownForAccessPolicy(const Node* node) const = 0; |
+ |
+ // Returns true if Embed(node) has been invoked for this connection. |
+ virtual bool IsNodeEmbeddedInAnotherConnectionForAccessPolicy( |
Ben Goodger (Google)
2014/07/25 20:51:46
Hrm... I think you could come up with a better nam
sky
2014/07/25 21:10:45
Actually, I'm saying something slightly different.
|
+ const Node* node) const = 0; |
+ |
+ protected: |
+ virtual ~AccessPolicyDelegate() {} |
+}; |
+ |
+} // namespace service |
+} // namespace mojo |
+ |
+#endif // MOJO_SERVICES_VIEW_MANAGER_ACCESS_POLICY_DELEGATE_H_ |