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::SetCanAcceptEvents(Id transport_window_id, | |
| 351 bool can_accept_events) { | |
| 352 ServerWindow* window = | |
| 353 GetWindowByClientId(ClientWindowId(transport_window_id)); | |
| 354 if (window && access_policy_->CanSetAcceptEvents(window)) | |
| 355 window->set_can_accept_events(can_accept_events); | |
|
sadrul
2016/07/12 17:32:33
Add a TODO here to check that there aren't any ent
riajiang
2016/07/12 18:46:40
Done.
| |
| 356 } | |
| 357 | |
| 350 bool WindowTree::Embed(const ClientWindowId& window_id, | 358 bool WindowTree::Embed(const ClientWindowId& window_id, |
| 351 mojom::WindowTreeClientPtr client, | 359 mojom::WindowTreeClientPtr client, |
| 352 uint32_t flags) { | 360 uint32_t flags) { |
| 353 if (!client || !CanEmbed(window_id)) | 361 if (!client || !CanEmbed(window_id)) |
| 354 return false; | 362 return false; |
| 355 ServerWindow* window = GetWindowByClientId(window_id); | 363 ServerWindow* window = GetWindowByClientId(window_id); |
| 356 PrepareForEmbed(window); | 364 PrepareForEmbed(window); |
| 357 // When embedding we don't know the user id of where the TreeClient came | 365 // 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. | 366 // from. Use an invalid id, which limits what the client is able to do. |
| 359 window_server_->EmbedAtWindow(window, InvalidUserId(), std::move(client), | 367 window_server_->EmbedAtWindow(window, InvalidUserId(), std::move(client), |
| (...skipping 1260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1620 } | 1628 } |
| 1621 | 1629 |
| 1622 bool WindowTree::IsWindowRootOfAnotherTreeForAccessPolicy( | 1630 bool WindowTree::IsWindowRootOfAnotherTreeForAccessPolicy( |
| 1623 const ServerWindow* window) const { | 1631 const ServerWindow* window) const { |
| 1624 WindowTree* tree = window_server_->GetTreeWithRoot(window); | 1632 WindowTree* tree = window_server_->GetTreeWithRoot(window); |
| 1625 return tree && tree != this; | 1633 return tree && tree != this; |
| 1626 } | 1634 } |
| 1627 | 1635 |
| 1628 } // namespace ws | 1636 } // namespace ws |
| 1629 } // namespace ui | 1637 } // namespace ui |
| OLD | NEW |