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.
5 #ifndef MOJO_SERVICES_VIEW_MANAGER_ACCESS_POLICY_DELEGATE_H_
6 #define MOJO_SERVICES_VIEW_MANAGER_ACCESS_POLICY_DELEGATE_H_
10 #include "base/containers/hash_tables.h"
11 #include "mojo/services/view_manager/ids.h"
18 // Delegate used by the AccessPolicy implementations to get state.
19 class AccessPolicyDelegate
{
21 // Returns the ids of the roots views for this connection. That is, this is
22 // the set of views the connection was embedded at.
23 virtual const base::hash_set
<Id
>& GetRootsForAccessPolicy() const = 0;
25 // Returns true if |view| has been exposed to the client.
26 virtual bool IsViewKnownForAccessPolicy(const ServerView
* view
) const = 0;
28 // Returns true if Embed(view) has been invoked on |view|.
29 virtual bool IsViewRootOfAnotherConnectionForAccessPolicy(
30 const ServerView
* view
) const = 0;
33 virtual ~AccessPolicyDelegate() {}
36 } // namespace service
39 #endif // MOJO_SERVICES_VIEW_MANAGER_ACCESS_POLICY_DELEGATE_H_