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_ACCESS_POLICY_DELEGATE_H_ | 5 #ifndef COMPONENTS_MUS_ACCESS_POLICY_DELEGATE_H_ |
6 #define COMPONENTS_MUS_ACCESS_POLICY_DELEGATE_H_ | 6 #define COMPONENTS_MUS_ACCESS_POLICY_DELEGATE_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/containers/hash_tables.h" | 10 #include "base/containers/hash_tables.h" |
11 #include "components/mus/ids.h" | 11 #include "components/mus/ids.h" |
12 | 12 |
13 namespace mus { | 13 namespace view_manager { |
14 | 14 |
15 class ServerView; | 15 class ServerView; |
16 | 16 |
17 // Delegate used by the AccessPolicy implementations to get state. | 17 // Delegate used by the AccessPolicy implementations to get state. |
18 class AccessPolicyDelegate { | 18 class AccessPolicyDelegate { |
19 public: | 19 public: |
20 // Returns true if |id| is the root of the connection. | 20 // Returns true if |id| is the root of the connection. |
21 virtual bool IsRootForAccessPolicy(const ViewId& id) const = 0; | 21 virtual bool IsRootForAccessPolicy(const ViewId& id) const = 0; |
22 | 22 |
23 // Returns true if |view| has been exposed to the client. | 23 // Returns true if |view| has been exposed to the client. |
24 virtual bool IsViewKnownForAccessPolicy(const ServerView* view) const = 0; | 24 virtual bool IsViewKnownForAccessPolicy(const ServerView* view) const = 0; |
25 | 25 |
26 // Returns true if Embed(view) has been invoked on |view|. | 26 // Returns true if Embed(view) has been invoked on |view|. |
27 virtual bool IsViewRootOfAnotherConnectionForAccessPolicy( | 27 virtual bool IsViewRootOfAnotherConnectionForAccessPolicy( |
28 const ServerView* view) const = 0; | 28 const ServerView* view) const = 0; |
29 | 29 |
30 // Returns true if SetEmbedRoot() was invoked and |view| is a descendant of | 30 // Returns true if SetEmbedRoot() was invoked and |view| is a descendant of |
31 // the root of the connection. | 31 // the root of the connection. |
32 virtual bool IsDescendantOfEmbedRoot(const ServerView* view) = 0; | 32 virtual bool IsDescendantOfEmbedRoot(const ServerView* view) = 0; |
33 | 33 |
34 protected: | 34 protected: |
35 virtual ~AccessPolicyDelegate() {} | 35 virtual ~AccessPolicyDelegate() {} |
36 }; | 36 }; |
37 | 37 |
38 } // namespace mus | 38 } // namespace view_manager |
39 | 39 |
40 #endif // COMPONENTS_MUS_ACCESS_POLICY_DELEGATE_H_ | 40 #endif // COMPONENTS_MUS_ACCESS_POLICY_DELEGATE_H_ |
OLD | NEW |