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

Side by Side Diff: mojo/services/view_manager/default_access_policy.cc

Issue 474883003: Move focus from the view manager to the window manager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 4 months 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 | Annotate | Revision Log
« no previous file with comments | « mojo/services/view_manager/default_access_policy.h ('k') | mojo/services/view_manager/node.h » ('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 #include "mojo/services/view_manager/default_access_policy.h" 5 #include "mojo/services/view_manager/default_access_policy.h"
6 6
7 #include "mojo/services/view_manager/access_policy_delegate.h" 7 #include "mojo/services/view_manager/access_policy_delegate.h"
8 #include "mojo/services/view_manager/node.h" 8 #include "mojo/services/view_manager/node.h"
9 9
10 namespace mojo { 10 namespace mojo {
(...skipping 28 matching lines...) Expand all
39 const Node* relative_node, 39 const Node* relative_node,
40 OrderDirection direction) const { 40 OrderDirection direction) const {
41 return WasCreatedByThisConnection(node) && 41 return WasCreatedByThisConnection(node) &&
42 WasCreatedByThisConnection(relative_node); 42 WasCreatedByThisConnection(relative_node);
43 } 43 }
44 44
45 bool DefaultAccessPolicy::CanDeleteNode(const Node* node) const { 45 bool DefaultAccessPolicy::CanDeleteNode(const Node* node) const {
46 return WasCreatedByThisConnection(node); 46 return WasCreatedByThisConnection(node);
47 } 47 }
48 48
49 bool DefaultAccessPolicy::CanSetFocus(const Node* node) const {
50 // TODO(beng): security.
51 return true;
52 }
53
54 bool DefaultAccessPolicy::CanGetNodeTree(const Node* node) const { 49 bool DefaultAccessPolicy::CanGetNodeTree(const Node* node) const {
55 return WasCreatedByThisConnection(node) || IsNodeInRoots(node); 50 return WasCreatedByThisConnection(node) || IsNodeInRoots(node);
56 } 51 }
57 52
58 bool DefaultAccessPolicy::CanDescendIntoNodeForNodeTree( 53 bool DefaultAccessPolicy::CanDescendIntoNodeForNodeTree(
59 const Node* node) const { 54 const Node* node) const {
60 return WasCreatedByThisConnection(node) && 55 return WasCreatedByThisConnection(node) &&
61 !delegate_->IsNodeRootOfAnotherConnectionForAccessPolicy(node); 56 !delegate_->IsNodeRootOfAnotherConnectionForAccessPolicy(node);
62 } 57 }
63 58
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 return view_id.connection_id == connection_id_; 99 return view_id.connection_id == connection_id_;
105 } 100 }
106 101
107 bool DefaultAccessPolicy::IsNodeInRoots(const Node* node) const { 102 bool DefaultAccessPolicy::IsNodeInRoots(const Node* node) const {
108 return delegate_->GetRootsForAccessPolicy().count( 103 return delegate_->GetRootsForAccessPolicy().count(
109 NodeIdToTransportId(node->id())) > 0; 104 NodeIdToTransportId(node->id())) > 0;
110 } 105 }
111 106
112 } // namespace service 107 } // namespace service
113 } // namespace mojo 108 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/services/view_manager/default_access_policy.h ('k') | mojo/services/view_manager/node.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698