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 1527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1538 } | 1538 } |
| 1539 | 1539 |
| 1540 void WindowTree::SetFocus(uint32_t change_id, Id transport_window_id) { | 1540 void WindowTree::SetFocus(uint32_t change_id, Id transport_window_id) { |
| 1541 client()->OnChangeCompleted(change_id, | 1541 client()->OnChangeCompleted(change_id, |
| 1542 SetFocus(ClientWindowId(transport_window_id))); | 1542 SetFocus(ClientWindowId(transport_window_id))); |
| 1543 } | 1543 } |
| 1544 | 1544 |
| 1545 void WindowTree::SetCanFocus(Id transport_window_id, bool can_focus) { | 1545 void WindowTree::SetCanFocus(Id transport_window_id, bool can_focus) { |
| 1546 ServerWindow* window = | 1546 ServerWindow* window = |
| 1547 GetWindowByClientId(ClientWindowId(transport_window_id)); | 1547 GetWindowByClientId(ClientWindowId(transport_window_id)); |
| 1548 // TODO(sky): there should be an else case (it shouldn't route to wm and | 1548 if (!window) |
| 1549 // policy allows, then set_can_focus). | 1549 return; |
|
sky
2017/01/26 18:59:04
Please log errors. See AddWindow() for an example
Hadi
2017/01/26 20:23:17
Done.
| |
| 1550 if (window && ShouldRouteToWindowManager(window)) | 1550 |
| 1551 if (ShouldRouteToWindowManager(window)) { | |
| 1552 WindowManagerDisplayRoot* display_root = | |
| 1553 GetWindowManagerDisplayRoot(window); | |
| 1554 WindowTree* wm_tree = display_root->window_manager_state()->window_tree(); | |
| 1555 wm_tree->window_manager_internal_->WmSetCanFocus(transport_window_id, | |
| 1556 can_focus); | |
| 1557 } else if (access_policy_->CanSetFocus(window)) { | |
| 1551 window->set_can_focus(can_focus); | 1558 window->set_can_focus(can_focus); |
| 1559 } | |
| 1552 } | 1560 } |
| 1553 | 1561 |
| 1554 void WindowTree::SetCanAcceptEvents(Id transport_window_id, | 1562 void WindowTree::SetCanAcceptEvents(Id transport_window_id, |
| 1555 bool can_accept_events) { | 1563 bool can_accept_events) { |
| 1556 ServerWindow* window = | 1564 ServerWindow* window = |
| 1557 GetWindowByClientId(ClientWindowId(transport_window_id)); | 1565 GetWindowByClientId(ClientWindowId(transport_window_id)); |
| 1558 // TODO(riajiang): check |event_queue_| is empty for |window|. | 1566 // TODO(riajiang): check |event_queue_| is empty for |window|. |
| 1559 if (window && access_policy_->CanSetAcceptEvents(window)) | 1567 if (window && access_policy_->CanSetAcceptEvents(window)) |
| 1560 window->set_can_accept_events(can_accept_events); | 1568 window->set_can_accept_events(can_accept_events); |
| 1561 } | 1569 } |
| (...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2080 client()->OnCompleteDrop(client_window_id.id, event_flags, cursor_offset, | 2088 client()->OnCompleteDrop(client_window_id.id, event_flags, cursor_offset, |
| 2081 effect_bitmask, callback); | 2089 effect_bitmask, callback); |
| 2082 } | 2090 } |
| 2083 | 2091 |
| 2084 void WindowTree::PerformOnDragDropDone() { | 2092 void WindowTree::PerformOnDragDropDone() { |
| 2085 client()->OnDragDropDone(); | 2093 client()->OnDragDropDone(); |
| 2086 } | 2094 } |
| 2087 | 2095 |
| 2088 } // namespace ws | 2096 } // namespace ws |
| 2089 } // namespace ui | 2097 } // namespace ui |
| OLD | NEW |