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

Side by Side Diff: mojo/services/view_manager/default_access_policy.cc

Issue 534843002: Convert view manager to surfaces with uploading shim in client lib (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove overzealous shutdown check in cc/surfaces, add NON_EXPORTED_BASE for windows build, saturate… Created 6 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 "mojo/services/view_manager/default_access_policy.h" 5 #include "mojo/services/view_manager/default_access_policy.h"
6 6
7 #include "mojo/services/view_manager/access_policy_delegate.h" 7 #include "mojo/services/view_manager/access_policy_delegate.h"
8 #include "mojo/services/view_manager/server_view.h" 8 #include "mojo/services/view_manager/server_view.h"
9 9
10 namespace mojo { 10 namespace mojo {
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 59
60 bool DefaultAccessPolicy::CanEmbed(const ServerView* view) const { 60 bool DefaultAccessPolicy::CanEmbed(const ServerView* view) const {
61 return WasCreatedByThisConnection(view); 61 return WasCreatedByThisConnection(view);
62 } 62 }
63 63
64 bool DefaultAccessPolicy::CanChangeViewVisibility( 64 bool DefaultAccessPolicy::CanChangeViewVisibility(
65 const ServerView* view) const { 65 const ServerView* view) const {
66 return WasCreatedByThisConnection(view) || IsViewInRoots(view); 66 return WasCreatedByThisConnection(view) || IsViewInRoots(view);
67 } 67 }
68 68
69 bool DefaultAccessPolicy::CanSetViewContents(const ServerView* view) const { 69 bool DefaultAccessPolicy::CanSetViewSurfaceId(const ServerView* view) const {
70 // Once a view embeds another app, the embedder app is no longer able to 70 // Once a view embeds another app, the embedder app is no longer able to
71 // call SetViewContents() - this ability is transferred to the embedded app. 71 // call SetViewSurfaceId() - this ability is transferred to the embedded app.
72 if (delegate_->IsViewRootOfAnotherConnectionForAccessPolicy(view)) 72 if (delegate_->IsViewRootOfAnotherConnectionForAccessPolicy(view))
73 return false; 73 return false;
74 return WasCreatedByThisConnection(view) || IsViewInRoots(view); 74 return WasCreatedByThisConnection(view) || IsViewInRoots(view);
75 } 75 }
76 76
77 bool DefaultAccessPolicy::CanSetViewBounds(const ServerView* view) const { 77 bool DefaultAccessPolicy::CanSetViewBounds(const ServerView* view) const {
78 return WasCreatedByThisConnection(view); 78 return WasCreatedByThisConnection(view);
79 } 79 }
80 80
81 bool DefaultAccessPolicy::ShouldNotifyOnHierarchyChange( 81 bool DefaultAccessPolicy::ShouldNotifyOnHierarchyChange(
(...skipping 15 matching lines...) Expand all
97 return true; 97 return true;
98 } 98 }
99 99
100 bool DefaultAccessPolicy::IsViewInRoots(const ServerView* view) const { 100 bool DefaultAccessPolicy::IsViewInRoots(const ServerView* view) const {
101 return delegate_->GetRootsForAccessPolicy().count( 101 return delegate_->GetRootsForAccessPolicy().count(
102 ViewIdToTransportId(view->id())) > 0; 102 ViewIdToTransportId(view->id())) > 0;
103 } 103 }
104 104
105 } // namespace service 105 } // namespace service
106 } // namespace mojo 106 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/services/view_manager/default_access_policy.h ('k') | mojo/services/view_manager/display_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698