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

Unified Diff: components/exo/wm_helper_mus.cc

Issue 2714763002: Change FocusSynchronizer to maintain active focus client and window. (Closed)
Patch Set: test Created 3 years, 9 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 | « components/exo/wm_helper_mus.h ('k') | ui/aura/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/exo/wm_helper_mus.cc
diff --git a/components/exo/wm_helper_mus.cc b/components/exo/wm_helper_mus.cc
index 07a60cfdce72879f5ee56a4801bd15992107325b..a13d09ff997059e1edfb87b5da58f06121da22e5 100644
--- a/components/exo/wm_helper_mus.cc
+++ b/components/exo/wm_helper_mus.cc
@@ -6,8 +6,11 @@
#include "ui/aura/client/focus_client.h"
#include "ui/aura/env.h"
+#include "ui/aura/mus/focus_synchronizer.h"
+#include "ui/aura/mus/window_tree_client.h"
#include "ui/aura/window.h"
#include "ui/display/manager/managed_display_info.h"
+#include "ui/views/mus/mus_client.h"
#include "ui/wm/public/activation_client.h"
namespace exo {
@@ -15,16 +18,20 @@ namespace exo {
// WMHelperMus, public:
WMHelperMus::WMHelperMus() {
- aura::Env* env = aura::Env::GetInstance();
- SetActiveFocusClient(env->active_focus_client(),
- env->active_focus_client_root());
- env->AddObserver(this);
+ aura::FocusSynchronizer* focus_synchronizer =
+ views::MusClient::Get()->window_tree_client()->focus_synchronizer();
+ SetActiveFocusClient(focus_synchronizer->active_focus_client(),
+ focus_synchronizer->active_focus_client_root());
+ focus_synchronizer->AddObserver(this);
}
WMHelperMus::~WMHelperMus() {
if (active_focus_client_)
active_focus_client_->RemoveObserver(this);
- aura::Env::GetInstance()->RemoveObserver(this);
+ views::MusClient::Get()
+ ->window_tree_client()
+ ->focus_synchronizer()
+ ->RemoveObserver(this);
}
////////////////////////////////////////////////////////////////////////////////
@@ -88,12 +95,10 @@ void WMHelperMus::PlayEarcon(int sound_key) const {
NOTIMPLEMENTED();
}
-void WMHelperMus::OnWindowInitialized(aura::Window* window) {}
-
void WMHelperMus::OnActiveFocusClientChanged(
aura::client::FocusClient* focus_client,
- aura::Window* window) {
- SetActiveFocusClient(focus_client, window);
+ aura::Window* focus_client_root) {
+ SetActiveFocusClient(focus_client, focus_client_root);
}
void WMHelperMus::OnWindowFocused(aura::Window* gained_focus,
« no previous file with comments | « components/exo/wm_helper_mus.h ('k') | ui/aura/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698