| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 const ServerView* view) const { | 50 const ServerView* view) const { |
| 51 return view->id() != ClonedViewId(); | 51 return view->id() != ClonedViewId(); |
| 52 } | 52 } |
| 53 | 53 |
| 54 bool WindowManagerAccessPolicy::CanEmbed(const ServerView* view) const { | 54 bool WindowManagerAccessPolicy::CanEmbed(const ServerView* view) const { |
| 55 return view->id().connection_id == connection_id_; | 55 return view->id().connection_id == connection_id_; |
| 56 } | 56 } |
| 57 | 57 |
| 58 bool WindowManagerAccessPolicy::CanChangeViewVisibility( | 58 bool WindowManagerAccessPolicy::CanChangeViewVisibility( |
| 59 const ServerView* view) const { | 59 const ServerView* view) const { |
| 60 return view->id().connection_id == connection_id_; | 60 // The WindowManager can change the visibility of the root too. |
| 61 return view->id().connection_id == connection_id_ || |
| 62 view->id() == RootViewId(); |
| 61 } | 63 } |
| 62 | 64 |
| 63 bool WindowManagerAccessPolicy::CanSetViewSurfaceId( | 65 bool WindowManagerAccessPolicy::CanSetViewSurfaceId( |
| 64 const ServerView* view) const { | 66 const ServerView* view) const { |
| 65 if (delegate_->IsViewRootOfAnotherConnectionForAccessPolicy(view)) | 67 if (delegate_->IsViewRootOfAnotherConnectionForAccessPolicy(view)) |
| 66 return false; | 68 return false; |
| 67 return view->id().connection_id == connection_id_ || | 69 return view->id().connection_id == connection_id_ || |
| 68 (delegate_->IsRootForAccessPolicy(view->id())); | 70 (delegate_->IsRootForAccessPolicy(view->id())); |
| 69 } | 71 } |
| 70 | 72 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 97 const ServerView* WindowManagerAccessPolicy::GetViewForFocusChange( | 99 const ServerView* WindowManagerAccessPolicy::GetViewForFocusChange( |
| 98 const ServerView* focused) { | 100 const ServerView* focused) { |
| 99 return focused; | 101 return focused; |
| 100 } | 102 } |
| 101 | 103 |
| 102 bool WindowManagerAccessPolicy::IsViewKnown(const ServerView* view) const { | 104 bool WindowManagerAccessPolicy::IsViewKnown(const ServerView* view) const { |
| 103 return delegate_->IsViewKnownForAccessPolicy(view); | 105 return delegate_->IsViewKnownForAccessPolicy(view); |
| 104 } | 106 } |
| 105 | 107 |
| 106 } // namespace view_manager | 108 } // namespace view_manager |
| OLD | NEW |