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

Unified Diff: ash/shell.cc

Issue 2843193002: chromeos: fix focus for mushrome (Closed)
Patch Set: feedback Created 3 years, 8 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 | « ash/root_window_controller.cc ('k') | ash/shell_port.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shell.cc
diff --git a/ash/shell.cc b/ash/shell.cc
index 11b3861a31b7cc78069445d521bb5500c53273bc..0d942a73ec0c2c82e5b09d72e4c12da3cae5f5da 100644
--- a/ash/shell.cc
+++ b/ash/shell.cc
@@ -139,7 +139,9 @@
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/env.h"
#include "ui/aura/layout_manager.h"
+#include "ui/aura/mus/focus_synchronizer.h"
#include "ui/aura/mus/user_activity_forwarder.h"
+#include "ui/aura/mus/window_tree_client.h"
#include "ui/aura/window.h"
#include "ui/aura/window_event_dispatcher.h"
#include "ui/base/ui_base_switches.h"
@@ -740,6 +742,11 @@ Shell::~Shell() {
// Depends on |focus_controller_|, so must be destroyed before.
window_tree_host_manager_.reset();
focus_controller_->RemoveObserver(this);
+ if (config != Config::CLASSIC &&
+ window_tree_client_->focus_synchronizer()->active_focus_client() ==
+ focus_controller_.get()) {
+ window_tree_client_->focus_synchronizer()->SetSingletonFocusClient(nullptr);
+ }
focus_controller_.reset();
screen_position_controller_.reset();
@@ -907,6 +914,10 @@ void Shell::Init(const ShellInitParams& init_params) {
focus_controller_ =
base::MakeUnique<::wm::FocusController>(new wm::AshFocusRules());
focus_controller_->AddObserver(this);
+ if (config != Config::CLASSIC) {
+ window_tree_client_->focus_synchronizer()->SetSingletonFocusClient(
+ focus_controller_.get());
+ }
screen_position_controller_.reset(new ScreenPositionController);
« no previous file with comments | « ash/root_window_controller.cc ('k') | ash/shell_port.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698