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

Unified Diff: ash/mus/top_level_window_factory.cc

Issue 2650833002: Set focusibility correctly when initializing a window in mus+ash. (Closed)
Patch Set: addressed feedback. 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 | « no previous file | ash/mus/window_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/mus/top_level_window_factory.cc
diff --git a/ash/mus/top_level_window_factory.cc b/ash/mus/top_level_window_factory.cc
index f3260d0d3482cc0cd3c78df6bd64c6f1a7ac2f03..5da134412986fcc425091f4824146a0b2c6c8870 100644
--- a/ash/mus/top_level_window_factory.cc
+++ b/ash/mus/top_level_window_factory.cc
@@ -21,6 +21,7 @@
#include "services/ui/public/interfaces/window_manager_constants.mojom.h"
#include "ui/aura/mus/property_converter.h"
#include "ui/aura/mus/property_utils.h"
+#include "ui/aura/mus/window_tree_client.h"
#include "ui/aura/window.h"
#include "ui/display/display.h"
@@ -186,6 +187,17 @@ aura::Window* CreateAndParentTopLevelWindow(
// No need to persist this value.
properties->erase(ui::mojom::WindowManager::kWindowIgnoredByShelf_Property);
}
+ if (properties->count(ui::mojom::WindowManager::kFocusable_InitProperty)) {
+ bool can_focus = mojo::ConvertTo<bool>(
+ (*properties)[ui::mojom::WindowManager::kFocusable_InitProperty]);
+ window_manager->window_tree_client()->SetCanFocus(window, can_focus);
+ NonClientFrameController* non_client_frame_controller =
+ NonClientFrameController::Get(window);
+ if (non_client_frame_controller)
+ non_client_frame_controller->set_can_activate(can_focus);
+ // No need to persist this value.
+ properties->erase(ui::mojom::WindowManager::kFocusable_InitProperty);
+ }
return window;
}
« no previous file with comments | « no previous file | ash/mus/window_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698