Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(482)

Side by Side Diff: services/ui/ws/window_tree.cc

Issue 2650833002: Set focusibility correctly when initializing a window in mus+ash. (Closed)
Patch Set: addressed feedback. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 DVLOG(1) << "SetCanFocus failed (invalid id)";
1550 if (window && ShouldRouteToWindowManager(window)) 1550 return;
1551 }
1552
1553 if (ShouldRouteToWindowManager(window)) {
1554 WindowManagerDisplayRoot* display_root =
1555 GetWindowManagerDisplayRoot(window);
1556 WindowTree* wm_tree = display_root->window_manager_state()->window_tree();
1557 wm_tree->window_manager_internal_->WmSetCanFocus(transport_window_id,
1558 can_focus);
1559 } else if (access_policy_->CanSetFocus(window)) {
1551 window->set_can_focus(can_focus); 1560 window->set_can_focus(can_focus);
1561 }
1552 } 1562 }
1553 1563
1554 void WindowTree::SetCanAcceptEvents(Id transport_window_id, 1564 void WindowTree::SetCanAcceptEvents(Id transport_window_id,
1555 bool can_accept_events) { 1565 bool can_accept_events) {
1556 ServerWindow* window = 1566 ServerWindow* window =
1557 GetWindowByClientId(ClientWindowId(transport_window_id)); 1567 GetWindowByClientId(ClientWindowId(transport_window_id));
1558 // TODO(riajiang): check |event_queue_| is empty for |window|. 1568 // TODO(riajiang): check |event_queue_| is empty for |window|.
1559 if (window && access_policy_->CanSetAcceptEvents(window)) 1569 if (window && access_policy_->CanSetAcceptEvents(window))
1560 window->set_can_accept_events(can_accept_events); 1570 window->set_can_accept_events(can_accept_events);
1561 } 1571 }
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after
2080 client()->OnCompleteDrop(client_window_id.id, event_flags, cursor_offset, 2090 client()->OnCompleteDrop(client_window_id.id, event_flags, cursor_offset,
2081 effect_bitmask, callback); 2091 effect_bitmask, callback);
2082 } 2092 }
2083 2093
2084 void WindowTree::PerformOnDragDropDone() { 2094 void WindowTree::PerformOnDragDropDone() {
2085 client()->OnDragDropDone(); 2095 client()->OnDragDropDone();
2086 } 2096 }
2087 2097
2088 } // namespace ws 2098 } // namespace ws
2089 } // namespace ui 2099 } // namespace ui
OLDNEW
« no previous file with comments | « services/ui/ws/window_server_test_base.cc ('k') | services/ui/ws/window_tree_client_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698