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

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

Issue 1352043005: mus: Implement Window Server Capture Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added a test 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/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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698