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 1529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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 // TODO(sky): there should be an else case (it shouldn't route to wm and |
| 1549 // policy allows, then set_can_focus). | 1549 // policy allows, then set_can_focus). |
| 1550 if (window && ShouldRouteToWindowManager(window)) | 1550 if (window && access_policy_->CanSetFocus(window)) |
|
sky
2017/01/23 21:28:29
This needs to go to the window manager too, otherw
Hadi
2017/01/24 18:42:32
Done.
| |
| 1551 window->set_can_focus(can_focus); | 1551 window->set_can_focus(can_focus); |
|
sadrul
2017/01/24 17:34:49
if (!window)
return;
if (ShouldRouteToWndowMana
sadrul
2017/01/24 17:35:23
Whoops, sorry. Please ignore this comment.
| |
| 1552 } | 1552 } |
| 1553 | 1553 |
| 1554 void WindowTree::SetCanAcceptEvents(Id transport_window_id, | 1554 void WindowTree::SetCanAcceptEvents(Id transport_window_id, |
| 1555 bool can_accept_events) { | 1555 bool can_accept_events) { |
| 1556 ServerWindow* window = | 1556 ServerWindow* window = |
| 1557 GetWindowByClientId(ClientWindowId(transport_window_id)); | 1557 GetWindowByClientId(ClientWindowId(transport_window_id)); |
| 1558 // TODO(riajiang): check |event_queue_| is empty for |window|. | 1558 // TODO(riajiang): check |event_queue_| is empty for |window|. |
| 1559 if (window && access_policy_->CanSetAcceptEvents(window)) | 1559 if (window && access_policy_->CanSetAcceptEvents(window)) |
| 1560 window->set_can_accept_events(can_accept_events); | 1560 window->set_can_accept_events(can_accept_events); |
| 1561 } | 1561 } |
| (...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2072 client()->OnCompleteDrop(client_window_id.id, event_flags, cursor_offset, | 2072 client()->OnCompleteDrop(client_window_id.id, event_flags, cursor_offset, |
| 2073 effect_bitmask, callback); | 2073 effect_bitmask, callback); |
| 2074 } | 2074 } |
| 2075 | 2075 |
| 2076 void WindowTree::PerformOnDragDropDone() { | 2076 void WindowTree::PerformOnDragDropDone() { |
| 2077 client()->OnDragDropDone(); | 2077 client()->OnDragDropDone(); |
| 2078 } | 2078 } |
| 2079 | 2079 |
| 2080 } // namespace ws | 2080 } // namespace ws |
| 2081 } // namespace ui | 2081 } // namespace ui |
| OLD | NEW |