Chromium Code Reviews| 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 "services/ui/ws/window_tree.h" | 5 #include "services/ui/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 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 340 } | 340 } |
| 341 | 341 |
| 342 Operation op(this, window_server_, OperationType::SET_FOCUS); | 342 Operation op(this, window_server_, OperationType::SET_FOCUS); |
| 343 bool success = window_server_->SetFocusedWindow(window); | 343 bool success = window_server_->SetFocusedWindow(window); |
| 344 if (!success) { | 344 if (!success) { |
| 345 DVLOG(1) << "SetFocus failure, could not SetFocusedWindow."; | 345 DVLOG(1) << "SetFocus failure, could not SetFocusedWindow."; |
| 346 } | 346 } |
| 347 return success; | 347 return success; |
| 348 } | 348 } |
| 349 | 349 |
| 350 void WindowTree::SetAcceptEvents(Id transport_window_id, bool accept_events) { | |
| 351 ServerWindow* window = | |
| 352 GetWindowByClientId(ClientWindowId(transport_window_id)); | |
|
sky
2016/07/06 16:21:25
nit: spacing should be 4 here. Run git cl format t
riajiang
2016/07/08 17:59:59
Done.
| |
| 353 if (window) | |
| 354 window->SetAcceptEvents(accept_events); | |
|
sky
2016/07/06 16:21:25
You should also make sure the client can actually
riajiang
2016/07/08 17:59:59
Done.
| |
| 355 } | |
| 356 | |
| 350 bool WindowTree::Embed(const ClientWindowId& window_id, | 357 bool WindowTree::Embed(const ClientWindowId& window_id, |
| 351 mojom::WindowTreeClientPtr client, | 358 mojom::WindowTreeClientPtr client, |
| 352 uint32_t flags) { | 359 uint32_t flags) { |
| 353 if (!client || !CanEmbed(window_id)) | 360 if (!client || !CanEmbed(window_id)) |
| 354 return false; | 361 return false; |
| 355 ServerWindow* window = GetWindowByClientId(window_id); | 362 ServerWindow* window = GetWindowByClientId(window_id); |
| 356 PrepareForEmbed(window); | 363 PrepareForEmbed(window); |
| 357 // When embedding we don't know the user id of where the TreeClient came | 364 // When embedding we don't know the user id of where the TreeClient came |
| 358 // from. Use an invalid id, which limits what the client is able to do. | 365 // from. Use an invalid id, which limits what the client is able to do. |
| 359 window_server_->EmbedAtWindow(window, InvalidUserId(), std::move(client), | 366 window_server_->EmbedAtWindow(window, InvalidUserId(), std::move(client), |
| (...skipping 1170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1530 } | 1537 } |
| 1531 | 1538 |
| 1532 bool WindowTree::IsWindowRootOfAnotherTreeForAccessPolicy( | 1539 bool WindowTree::IsWindowRootOfAnotherTreeForAccessPolicy( |
| 1533 const ServerWindow* window) const { | 1540 const ServerWindow* window) const { |
| 1534 WindowTree* tree = window_server_->GetTreeWithRoot(window); | 1541 WindowTree* tree = window_server_->GetTreeWithRoot(window); |
| 1535 return tree && tree != this; | 1542 return tree && tree != this; |
| 1536 } | 1543 } |
| 1537 | 1544 |
| 1538 } // namespace ws | 1545 } // namespace ws |
| 1539 } // namespace ui | 1546 } // namespace ui |
| OLD | NEW |