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

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: cleanup. Created 3 years, 11 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
« no previous file with comments | « services/ui/public/interfaces/window_manager.mojom ('k') | ui/views/mus/mus_client.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 return;
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->SetCanFocus(transport_window_id, can_focus);
sadrul 2017/01/26 06:27:35 My reading of the TODO is that you want to notify
Hadi 2017/01/26 17:34:25 Done.
1556 } else if (access_policy_->CanSetFocus(window)) {
1551 window->set_can_focus(can_focus); 1557 window->set_can_focus(can_focus);
1558 }
1552 } 1559 }
1553 1560
1554 void WindowTree::SetCanAcceptEvents(Id transport_window_id, 1561 void WindowTree::SetCanAcceptEvents(Id transport_window_id,
1555 bool can_accept_events) { 1562 bool can_accept_events) {
1556 ServerWindow* window = 1563 ServerWindow* window =
1557 GetWindowByClientId(ClientWindowId(transport_window_id)); 1564 GetWindowByClientId(ClientWindowId(transport_window_id));
1558 // TODO(riajiang): check |event_queue_| is empty for |window|. 1565 // TODO(riajiang): check |event_queue_| is empty for |window|.
1559 if (window && access_policy_->CanSetAcceptEvents(window)) 1566 if (window && access_policy_->CanSetAcceptEvents(window))
1560 window->set_can_accept_events(can_accept_events); 1567 window->set_can_accept_events(can_accept_events);
1561 } 1568 }
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after
2072 client()->OnCompleteDrop(client_window_id.id, event_flags, cursor_offset, 2079 client()->OnCompleteDrop(client_window_id.id, event_flags, cursor_offset,
2073 effect_bitmask, callback); 2080 effect_bitmask, callback);
2074 } 2081 }
2075 2082
2076 void WindowTree::PerformOnDragDropDone() { 2083 void WindowTree::PerformOnDragDropDone() {
2077 client()->OnDragDropDone(); 2084 client()->OnDragDropDone();
2078 } 2085 }
2079 2086
2080 } // namespace ws 2087 } // namespace ws
2081 } // namespace ui 2088 } // namespace ui
OLDNEW
« no previous file with comments | « services/ui/public/interfaces/window_manager.mojom ('k') | ui/views/mus/mus_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698