| 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 1546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1557 WindowManagerDisplayRoot* display_root = | 1557 WindowManagerDisplayRoot* display_root = |
| 1558 GetWindowManagerDisplayRoot(window); | 1558 GetWindowManagerDisplayRoot(window); |
| 1559 WindowTree* wm_tree = display_root->window_manager_state()->window_tree(); | 1559 WindowTree* wm_tree = display_root->window_manager_state()->window_tree(); |
| 1560 wm_tree->window_manager_internal_->WmSetCanFocus(transport_window_id, | 1560 wm_tree->window_manager_internal_->WmSetCanFocus(transport_window_id, |
| 1561 can_focus); | 1561 can_focus); |
| 1562 } else if (access_policy_->CanSetFocus(window)) { | 1562 } else if (access_policy_->CanSetFocus(window)) { |
| 1563 window->set_can_focus(can_focus); | 1563 window->set_can_focus(can_focus); |
| 1564 } | 1564 } |
| 1565 } | 1565 } |
| 1566 | 1566 |
| 1567 void WindowTree::SetCanAcceptEvents(Id transport_window_id, | 1567 void WindowTree::SetEventTargetingPolicy(Id transport_window_id, |
| 1568 bool can_accept_events) { | 1568 mojom::EventTargetingPolicy policy) { |
| 1569 ServerWindow* window = | 1569 ServerWindow* window = |
| 1570 GetWindowByClientId(ClientWindowId(transport_window_id)); | 1570 GetWindowByClientId(ClientWindowId(transport_window_id)); |
| 1571 // TODO(riajiang): check |event_queue_| is empty for |window|. | 1571 // TODO(riajiang): check |event_queue_| is empty for |window|. |
| 1572 if (window && access_policy_->CanSetAcceptEvents(window)) | 1572 if (window && access_policy_->CanSetEventTargetingPolicy(window)) |
| 1573 window->set_can_accept_events(can_accept_events); | 1573 window->set_event_targeting_policy(policy); |
| 1574 } | 1574 } |
| 1575 | 1575 |
| 1576 void WindowTree::SetPredefinedCursor(uint32_t change_id, | 1576 void WindowTree::SetPredefinedCursor(uint32_t change_id, |
| 1577 Id transport_window_id, | 1577 Id transport_window_id, |
| 1578 ui::mojom::Cursor cursor_id) { | 1578 ui::mojom::Cursor cursor_id) { |
| 1579 ServerWindow* window = | 1579 ServerWindow* window = |
| 1580 GetWindowByClientId(ClientWindowId(transport_window_id)); | 1580 GetWindowByClientId(ClientWindowId(transport_window_id)); |
| 1581 | 1581 |
| 1582 // Only the owner of the window can change the bounds. | 1582 // Only the owner of the window can change the bounds. |
| 1583 bool success = window && access_policy_->CanSetCursorProperties(window); | 1583 bool success = window && access_policy_->CanSetCursorProperties(window); |
| (...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2151 client()->OnCompleteDrop(client_window_id.id, event_flags, cursor_offset, | 2151 client()->OnCompleteDrop(client_window_id.id, event_flags, cursor_offset, |
| 2152 effect_bitmask, callback); | 2152 effect_bitmask, callback); |
| 2153 } | 2153 } |
| 2154 | 2154 |
| 2155 void WindowTree::PerformOnDragDropDone() { | 2155 void WindowTree::PerformOnDragDropDone() { |
| 2156 client()->OnDragDropDone(); | 2156 client()->OnDragDropDone(); |
| 2157 } | 2157 } |
| 2158 | 2158 |
| 2159 } // namespace ws | 2159 } // namespace ws |
| 2160 } // namespace ui | 2160 } // namespace ui |
| OLD | NEW |