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 1366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1377 | 1377 |
1378 void WindowTree::SetCanFocus(Id transport_window_id, bool can_focus) { | 1378 void WindowTree::SetCanFocus(Id transport_window_id, bool can_focus) { |
1379 ServerWindow* window = | 1379 ServerWindow* window = |
1380 GetWindowByClientId(ClientWindowId(transport_window_id)); | 1380 GetWindowByClientId(ClientWindowId(transport_window_id)); |
1381 // TODO(sky): there should be an else case (it shouldn't route to wm and | 1381 // TODO(sky): there should be an else case (it shouldn't route to wm and |
1382 // policy allows, then set_can_focus). | 1382 // policy allows, then set_can_focus). |
1383 if (window && ShouldRouteToWindowManager(window)) | 1383 if (window && ShouldRouteToWindowManager(window)) |
1384 window->set_can_focus(can_focus); | 1384 window->set_can_focus(can_focus); |
1385 } | 1385 } |
1386 | 1386 |
| 1387 void WindowTree::SetCanAcceptEvents(Id transport_window_id, |
| 1388 bool can_accept_events) { |
| 1389 ServerWindow* window = |
| 1390 GetWindowByClientId(ClientWindowId(transport_window_id)); |
| 1391 // TODO(riajiang): check |event_queue_| is empty for |window|. |
| 1392 if (window && access_policy_->CanSetAcceptEvents(window)) |
| 1393 window->set_can_accept_events(can_accept_events); |
| 1394 } |
| 1395 |
1387 void WindowTree::SetPredefinedCursor(uint32_t change_id, | 1396 void WindowTree::SetPredefinedCursor(uint32_t change_id, |
1388 Id transport_window_id, | 1397 Id transport_window_id, |
1389 ui::mojom::Cursor cursor_id) { | 1398 ui::mojom::Cursor cursor_id) { |
1390 ServerWindow* window = | 1399 ServerWindow* window = |
1391 GetWindowByClientId(ClientWindowId(transport_window_id)); | 1400 GetWindowByClientId(ClientWindowId(transport_window_id)); |
1392 | 1401 |
1393 // Only the owner of the window can change the bounds. | 1402 // Only the owner of the window can change the bounds. |
1394 bool success = window && access_policy_->CanSetCursorProperties(window); | 1403 bool success = window && access_policy_->CanSetCursorProperties(window); |
1395 if (success) { | 1404 if (success) { |
1396 Operation op(this, window_server_, | 1405 Operation op(this, window_server_, |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1642 } | 1651 } |
1643 | 1652 |
1644 bool WindowTree::IsWindowRootOfAnotherTreeForAccessPolicy( | 1653 bool WindowTree::IsWindowRootOfAnotherTreeForAccessPolicy( |
1645 const ServerWindow* window) const { | 1654 const ServerWindow* window) const { |
1646 WindowTree* tree = window_server_->GetTreeWithRoot(window); | 1655 WindowTree* tree = window_server_->GetTreeWithRoot(window); |
1647 return tree && tree != this; | 1656 return tree && tree != this; |
1648 } | 1657 } |
1649 | 1658 |
1650 } // namespace ws | 1659 } // namespace ws |
1651 } // namespace ui | 1660 } // namespace ui |
OLD | NEW |