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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/ws/window_tree.cc
diff --git a/services/ui/ws/window_tree.cc b/services/ui/ws/window_tree.cc
index 77fd68d27593e422e7f7bb13f46894584bdf0988..0b735c9961e4cab9cc9fcd7b86b62cf989846364 100644
--- a/services/ui/ws/window_tree.cc
+++ b/services/ui/ws/window_tree.cc
@@ -1545,10 +1545,17 @@ 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)
+ return;
+
+ if (ShouldRouteToWindowManager(window)) {
+ WindowManagerDisplayRoot* display_root =
+ GetWindowManagerDisplayRoot(window);
+ WindowTree* wm_tree = display_root->window_manager_state()->window_tree();
+ 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.
+ } else if (access_policy_->CanSetFocus(window)) {
window->set_can_focus(can_focus);
+ }
}
void WindowTree::SetCanAcceptEvents(Id transport_window_id,
« 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