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

Side by Side Diff: services/ui/ws/window_manager_access_policy.cc

Issue 2277563002: Wires up immersive mode for chrome and mash (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix crash Created 4 years, 4 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 "services/ui/ws/window_manager_access_policy.h" 5 #include "services/ui/ws/window_manager_access_policy.h"
6 6
7 #include "services/ui/ws/access_policy_delegate.h" 7 #include "services/ui/ws/access_policy_delegate.h"
8 #include "services/ui/ws/server_window.h" 8 #include "services/ui/ws/server_window.h"
9 9
10 namespace ui { 10 namespace ui {
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 } 82 }
83 83
84 bool WindowManagerAccessPolicy::CanChangeWindowOpacity( 84 bool WindowManagerAccessPolicy::CanChangeWindowOpacity(
85 const ServerWindow* window) const { 85 const ServerWindow* window) const {
86 return WasCreatedByThisClient(window); 86 return WasCreatedByThisClient(window);
87 } 87 }
88 88
89 bool WindowManagerAccessPolicy::CanSetWindowSurface( 89 bool WindowManagerAccessPolicy::CanSetWindowSurface(
90 const ServerWindow* window, 90 const ServerWindow* window,
91 ui::mojom::SurfaceType surface_type) const { 91 ui::mojom::SurfaceType surface_type) const {
92 // Allow the window manager to always provide the underlay. This is important
93 // when the window manager is asked to paint the title area to windows it did
94 // not create.
92 if (surface_type == mojom::SurfaceType::UNDERLAY) 95 if (surface_type == mojom::SurfaceType::UNDERLAY)
93 return WasCreatedByThisClient(window); 96 return true;
94 97
95 if (delegate_->IsWindowRootOfAnotherTreeForAccessPolicy(window)) 98 if (delegate_->IsWindowRootOfAnotherTreeForAccessPolicy(window))
96 return false; 99 return false;
100
97 return WasCreatedByThisClient(window) || 101 return WasCreatedByThisClient(window) ||
98 (delegate_->HasRootForAccessPolicy(window)); 102 (delegate_->HasRootForAccessPolicy(window));
99 } 103 }
100 104
101 bool WindowManagerAccessPolicy::CanSetWindowBounds( 105 bool WindowManagerAccessPolicy::CanSetWindowBounds(
102 const ServerWindow* window) const { 106 const ServerWindow* window) const {
103 return WasCreatedByThisClient(window); 107 return WasCreatedByThisClient(window);
104 } 108 }
105 109
106 bool WindowManagerAccessPolicy::CanSetWindowProperties( 110 bool WindowManagerAccessPolicy::CanSetWindowProperties(
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 return WindowIdFromTransportId(id.id).client_id == client_id_; 190 return WindowIdFromTransportId(id.id).client_id == client_id_;
187 } 191 }
188 192
189 bool WindowManagerAccessPolicy::WasCreatedByThisClient( 193 bool WindowManagerAccessPolicy::WasCreatedByThisClient(
190 const ServerWindow* window) const { 194 const ServerWindow* window) const {
191 return window->id().client_id == client_id_; 195 return window->id().client_id == client_id_;
192 } 196 }
193 197
194 } // namespace ws 198 } // namespace ws
195 } // namespace ui 199 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698