| Index: services/ui/ws/window_tree.cc
|
| diff --git a/services/ui/ws/window_tree.cc b/services/ui/ws/window_tree.cc
|
| index 1fb3e481e9fa42ffc638627e8c523b92c7417b7c..7170b7c10e02c8886baa22f044f81a76b4bbbb26 100644
|
| --- a/services/ui/ws/window_tree.cc
|
| +++ b/services/ui/ws/window_tree.cc
|
| @@ -1545,10 +1545,20 @@ void WindowTree::SetFocus(uint32_t change_id, Id transport_window_id) {
|
| void WindowTree::SetCanFocus(Id transport_window_id, bool can_focus) {
|
| ServerWindow* window =
|
| GetWindowByClientId(ClientWindowId(transport_window_id));
|
| - // TODO(sky): there should be an else case (it shouldn't route to wm and
|
| - // policy allows, then set_can_focus).
|
| - if (window && ShouldRouteToWindowManager(window))
|
| + if (!window) {
|
| + DVLOG(1) << "SetCanFocus failed (invalid id)";
|
| + return;
|
| + }
|
| +
|
| + if (ShouldRouteToWindowManager(window)) {
|
| + WindowManagerDisplayRoot* display_root =
|
| + GetWindowManagerDisplayRoot(window);
|
| + WindowTree* wm_tree = display_root->window_manager_state()->window_tree();
|
| + wm_tree->window_manager_internal_->WmSetCanFocus(transport_window_id,
|
| + can_focus);
|
| + } else if (access_policy_->CanSetFocus(window)) {
|
| window->set_can_focus(can_focus);
|
| + }
|
| }
|
|
|
| void WindowTree::SetCanAcceptEvents(Id transport_window_id,
|
|
|