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/window_manager_access_policy.h" | 5 #include "components/view_manager/window_manager_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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 | 81 |
82 bool WindowManagerAccessPolicy::CanSetViewTextInputState( | 82 bool WindowManagerAccessPolicy::CanSetViewTextInputState( |
83 const ServerView* view) const { | 83 const ServerView* view) const { |
84 return view->id().connection_id == connection_id_; | 84 return view->id().connection_id == connection_id_; |
85 } | 85 } |
86 | 86 |
87 bool WindowManagerAccessPolicy::CanSetFocus(const ServerView* view) const { | 87 bool WindowManagerAccessPolicy::CanSetFocus(const ServerView* view) const { |
88 return true; | 88 return true; |
89 } | 89 } |
90 | 90 |
| 91 bool WindowManagerAccessPolicy::CanSetAccessPolicy( |
| 92 const ServerView* view) const { |
| 93 return true; |
| 94 } |
| 95 |
91 bool WindowManagerAccessPolicy::ShouldNotifyOnHierarchyChange( | 96 bool WindowManagerAccessPolicy::ShouldNotifyOnHierarchyChange( |
92 const ServerView* view, | 97 const ServerView* view, |
93 const ServerView** new_parent, | 98 const ServerView** new_parent, |
94 const ServerView** old_parent) const { | 99 const ServerView** old_parent) const { |
95 // Notify if we've already told the window manager about the view, or if we've | 100 // Notify if we've already told the window manager about the view, or if we've |
96 // already told the window manager about the parent. The later handles the | 101 // already told the window manager about the parent. The later handles the |
97 // case of a view that wasn't parented to the root getting added to the root. | 102 // case of a view that wasn't parented to the root getting added to the root. |
98 return IsViewKnown(view) || (*new_parent && IsViewKnown(*new_parent)); | 103 return IsViewKnown(view) || (*new_parent && IsViewKnown(*new_parent)); |
99 } | 104 } |
100 | 105 |
101 const ServerView* WindowManagerAccessPolicy::GetViewForFocusChange( | 106 const ServerView* WindowManagerAccessPolicy::GetViewForFocusChange( |
102 const ServerView* focused) { | 107 const ServerView* focused) { |
103 return focused; | 108 return focused; |
104 } | 109 } |
105 | 110 |
106 bool WindowManagerAccessPolicy::IsViewKnown(const ServerView* view) const { | 111 bool WindowManagerAccessPolicy::IsViewKnown(const ServerView* view) const { |
107 return delegate_->IsViewKnownForAccessPolicy(view); | 112 return delegate_->IsViewKnownForAccessPolicy(view); |
108 } | 113 } |
109 | 114 |
110 } // namespace view_manager | 115 } // namespace view_manager |
OLD | NEW |