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

Unified Diff: ash/shell.cc

Issue 2843193002: chromeos: fix focus for mushrome (Closed)
Patch Set: cleanup 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
Index: ash/shell.cc
diff --git a/ash/shell.cc b/ash/shell.cc
index 11b3861a31b7cc78069445d521bb5500c53273bc..45dde77844861c0555c08a3ac6a65c2c934846e5 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"
@@ -152,6 +154,7 @@
#include "ui/display/manager/chromeos/display_configurator.h"
#include "ui/display/manager/display_manager.h"
#include "ui/display/screen.h"
+#include "ui/display/types/native_display_delegate.h"
msw 2017/04/26 23:01:08 nit: remove if not needed
sky 2017/04/26 23:30:28 Done.
#include "ui/events/event_target_iterator.h"
#include "ui/gfx/geometry/insets.h"
#include "ui/gfx/image/image_skia.h"
@@ -740,6 +743,11 @@ Shell::~Shell() {
// Depends on |focus_controller_|, so must be destroyed before.
window_tree_host_manager_.reset();
focus_controller_->RemoveObserver(this);
+ if (GetAshConfig() != Config::CLASSIC &&
msw 2017/04/26 23:01:08 nit: use |config| (line 592)
sky 2017/04/26 23:30:28 Done.
+ 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 +915,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);

Powered by Google App Engine
This is Rietveld 408576698