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

Side by Side Diff: components/view_manager/default_access_policy.cc

Issue 1317713006: Changes around how embed roots are set (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge to trunk Created 5 years, 3 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
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 "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
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
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
OLDNEW
« no previous file with comments | « components/view_manager/default_access_policy.h ('k') | components/view_manager/public/cpp/lib/view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698