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