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 #include "components/view_manager/default_access_policy.h" | 5 #include "components/view_manager/default_access_policy.h" |
6 | 6 |
7 #include "components/view_manager/access_policy_delegate.h" | 7 #include "components/view_manager/access_policy_delegate.h" |
8 #include "components/view_manager/server_view.h" | 8 #include "components/view_manager/server_view.h" |
9 | 9 |
10 namespace view_manager { | 10 namespace view_manager { |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 const ServerView* view) const { | 93 const ServerView* view) const { |
94 return WasCreatedByThisConnection(view) || | 94 return WasCreatedByThisConnection(view) || |
95 delegate_->IsRootForAccessPolicy(view->id()); | 95 delegate_->IsRootForAccessPolicy(view->id()); |
96 } | 96 } |
97 | 97 |
98 bool DefaultAccessPolicy::CanSetFocus(const ServerView* view) const { | 98 bool DefaultAccessPolicy::CanSetFocus(const ServerView* view) const { |
99 return WasCreatedByThisConnection(view) || | 99 return WasCreatedByThisConnection(view) || |
100 delegate_->IsRootForAccessPolicy(view->id()); | 100 delegate_->IsRootForAccessPolicy(view->id()); |
101 } | 101 } |
102 | 102 |
| 103 bool DefaultAccessPolicy::CanSetAccessPolicy(const ServerView* view) const { |
| 104 return false; |
| 105 } |
| 106 |
103 bool DefaultAccessPolicy::ShouldNotifyOnHierarchyChange( | 107 bool DefaultAccessPolicy::ShouldNotifyOnHierarchyChange( |
104 const ServerView* view, | 108 const ServerView* view, |
105 const ServerView** new_parent, | 109 const ServerView** new_parent, |
106 const ServerView** old_parent) const { | 110 const ServerView** old_parent) const { |
107 if (!WasCreatedByThisConnection(view) && !IsDescendantOfEmbedRoot(view) && | 111 if (!WasCreatedByThisConnection(view) && !IsDescendantOfEmbedRoot(view) && |
108 (!*new_parent || !IsDescendantOfEmbedRoot(*new_parent)) && | 112 (!*new_parent || !IsDescendantOfEmbedRoot(*new_parent)) && |
109 (!*old_parent || !IsDescendantOfEmbedRoot(*old_parent))) { | 113 (!*old_parent || !IsDescendantOfEmbedRoot(*old_parent))) { |
110 return false; | 114 return false; |
111 } | 115 } |
112 | 116 |
(...skipping 23 matching lines...) Expand all Loading... |
136 const ServerView* view) const { | 140 const ServerView* view) const { |
137 return view->id().connection_id == connection_id_; | 141 return view->id().connection_id == connection_id_; |
138 } | 142 } |
139 | 143 |
140 bool DefaultAccessPolicy::IsDescendantOfEmbedRoot( | 144 bool DefaultAccessPolicy::IsDescendantOfEmbedRoot( |
141 const ServerView* view) const { | 145 const ServerView* view) const { |
142 return delegate_->IsDescendantOfEmbedRoot(view); | 146 return delegate_->IsDescendantOfEmbedRoot(view); |
143 } | 147 } |
144 | 148 |
145 } // namespace view_manager | 149 } // namespace view_manager |
OLD | NEW |