Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(468)

Side by Side Diff: mojo/services/view_manager/access_policy_delegate.h

Issue 699173003: Makes ViewManagerServiceImpl track a single root (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: comment Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | mojo/services/view_manager/connection_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 MOJO_SERVICES_VIEW_MANAGER_ACCESS_POLICY_DELEGATE_H_
6 #define MOJO_SERVICES_VIEW_MANAGER_ACCESS_POLICY_DELEGATE_H_ 6 #define MOJO_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 "mojo/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 the ids of the roots views for this connection. That is, this is 21 // Returns true if |id| is the root of the connection.
22 // the set of views the connection was embedded at. 22 virtual bool IsRootForAccessPolicy(const ViewId& id) const = 0;
23 virtual const base::hash_set<Id>& GetRootsForAccessPolicy() const = 0;
24 23
25 // Returns true if |view| has been exposed to the client. 24 // Returns true if |view| has been exposed to the client.
26 virtual bool IsViewKnownForAccessPolicy(const ServerView* view) const = 0; 25 virtual bool IsViewKnownForAccessPolicy(const ServerView* view) const = 0;
27 26
28 // Returns true if Embed(view) has been invoked on |view|. 27 // Returns true if Embed(view) has been invoked on |view|.
29 virtual bool IsViewRootOfAnotherConnectionForAccessPolicy( 28 virtual bool IsViewRootOfAnotherConnectionForAccessPolicy(
30 const ServerView* view) const = 0; 29 const ServerView* view) const = 0;
31 30
32 protected: 31 protected:
33 virtual ~AccessPolicyDelegate() {} 32 virtual ~AccessPolicyDelegate() {}
34 }; 33 };
35 34
36 } // namespace service 35 } // namespace service
37 } // namespace mojo 36 } // namespace mojo
38 37
39 #endif // MOJO_SERVICES_VIEW_MANAGER_ACCESS_POLICY_DELEGATE_H_ 38 #endif // MOJO_SERVICES_VIEW_MANAGER_ACCESS_POLICY_DELEGATE_H_
OLDNEW
« no previous file with comments | « no previous file | mojo/services/view_manager/connection_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698