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

Unified Diff: mojo/services/view_manager/window_manager_access_policy.cc

Issue 720883003: Adds a CloneAndAnimate function to WindowManagerInternalClient (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Add GetView(ClonedViewId) coverage Created 6 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/services/view_manager/view_manager_service_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/services/view_manager/window_manager_access_policy.cc
diff --git a/mojo/services/view_manager/window_manager_access_policy.cc b/mojo/services/view_manager/window_manager_access_policy.cc
index 8a477f064d4b5c71ecf7029f874157f1fce3f59e..625b24ac16abc0d79ab33d91d2c56428093c4090 100644
--- a/mojo/services/view_manager/window_manager_access_policy.cc
+++ b/mojo/services/view_manager/window_manager_access_policy.cc
@@ -44,12 +44,12 @@ bool WindowManagerAccessPolicy::CanDeleteView(const ServerView* view) const {
}
bool WindowManagerAccessPolicy::CanGetViewTree(const ServerView* view) const {
- return true;
+ return view->id() != ClonedViewId();
}
bool WindowManagerAccessPolicy::CanDescendIntoViewForViewTree(
const ServerView* view) const {
- return true;
+ return view->id() != ClonedViewId();
}
bool WindowManagerAccessPolicy::CanEmbed(const ServerView* view) const {
@@ -82,6 +82,9 @@ bool WindowManagerAccessPolicy::ShouldNotifyOnHierarchyChange(
const ServerView* view,
const ServerView** new_parent,
const ServerView** old_parent) const {
+ if (view->id() == ClonedViewId())
+ return false;
+
// Notify if we've already told the window manager about the view, or if we've
// already told the window manager about the parent. The later handles the
// case of a view that wasn't parented to the root getting added to the root.
« no previous file with comments | « mojo/services/view_manager/view_manager_service_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698