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