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

Side by Side Diff: components/mus/ws/window_tree.cc

Issue 1979323002: mus: Show USER_PRIVATE window container during views tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@widgetinteractive
Patch Set: Created 4 years, 7 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/ws/window_tree.h" 5 #include "components/mus/ws/window_tree.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 if (window->opacity() == opacity) 287 if (window->opacity() == opacity)
288 return true; 288 return true;
289 Operation op(this, window_server_, OperationType::SET_WINDOW_OPACITY); 289 Operation op(this, window_server_, OperationType::SET_WINDOW_OPACITY);
290 window->SetOpacity(opacity); 290 window->SetOpacity(opacity);
291 return true; 291 return true;
292 } 292 }
293 293
294 bool WindowTree::SetFocus(const ClientWindowId& window_id) { 294 bool WindowTree::SetFocus(const ClientWindowId& window_id) {
295 ServerWindow* window = GetWindowByClientId(window_id); 295 ServerWindow* window = GetWindowByClientId(window_id);
296 ServerWindow* currently_focused = window_server_->GetFocusedWindow(); 296 ServerWindow* currently_focused = window_server_->GetFocusedWindow();
297 if (!currently_focused && !window) 297 if (!currently_focused && !window) {
298 LOG(WARNING) << "SetFocus failure, no focused window to clear.";
sky 2016/05/16 19:44:27 I think these should be DVLOGs.
James Cook 2016/05/16 20:57:44 How about DLOG? My concern with DVLOG is that no o
James Cook 2016/05/16 21:43:01 Discussed offline, switched to DVLOG.
298 return false; 299 return false;
300 }
299 301
300 Display* display = GetDisplay(window); 302 Display* display = GetDisplay(window);
301 if (window && (!display || !window->can_focus() || !window->IsDrawn())) 303 if (window && (!display || !window->can_focus() || !window->IsDrawn())) {
304 LOG(WARNING) << "SetFocus failure, window cannot be focused.";
302 return false; 305 return false;
306 }
303 307
304 if (!access_policy_->CanSetFocus(window)) 308 if (!access_policy_->CanSetFocus(window)) {
309 LOG(WARNING) << "SetFocus failure, blocked by access policy.";
305 return false; 310 return false;
311 }
306 312
307 Operation op(this, window_server_, OperationType::SET_FOCUS); 313 Operation op(this, window_server_, OperationType::SET_FOCUS);
308 return window_server_->SetFocusedWindow(window); 314 bool success = window_server_->SetFocusedWindow(window);
315 if (!success) {
316 LOG(WARNING) << "SetFocus failure, could not SetFocusedWindow.";
317 }
318 return success;
309 } 319 }
310 320
311 bool WindowTree::Embed(const ClientWindowId& window_id, 321 bool WindowTree::Embed(const ClientWindowId& window_id,
312 mojom::WindowTreeClientPtr client) { 322 mojom::WindowTreeClientPtr client) {
313 if (!client || !CanEmbed(window_id)) 323 if (!client || !CanEmbed(window_id))
314 return false; 324 return false;
315 ServerWindow* window = GetWindowByClientId(window_id); 325 ServerWindow* window = GetWindowByClientId(window_id);
316 PrepareForEmbed(window); 326 PrepareForEmbed(window);
317 // When embedding we don't know the user id of where the TreeClient came 327 // When embedding we don't know the user id of where the TreeClient came
318 // from. Use an invalid id, which limits what the client is able to do. 328 // from. Use an invalid id, which limits what the client is able to do.
(...skipping 1136 matching lines...) Expand 10 before | Expand all | Expand 10 after
1455 } 1465 }
1456 1466
1457 bool WindowTree::IsWindowRootOfAnotherTreeForAccessPolicy( 1467 bool WindowTree::IsWindowRootOfAnotherTreeForAccessPolicy(
1458 const ServerWindow* window) const { 1468 const ServerWindow* window) const {
1459 WindowTree* tree = window_server_->GetTreeWithRoot(window); 1469 WindowTree* tree = window_server_->GetTreeWithRoot(window);
1460 return tree && tree != this; 1470 return tree && tree != this;
1461 } 1471 }
1462 1472
1463 } // namespace ws 1473 } // namespace ws
1464 } // namespace mus 1474 } // namespace mus
OLDNEW
« no previous file with comments | « components/mus/public/cpp/tests/window_server_shelltest_base.cc ('k') | mash/wm/root_window_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698