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

Unified Diff: components/exo/keyboard.cc

Issue 2242283002: Add an adapter layer (WMHelper) between exo and ash. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix build errors. Created 4 years, 4 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/keyboard.h ('k') | components/exo/pointer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/exo/keyboard.cc
diff --git a/components/exo/keyboard.cc b/components/exo/keyboard.cc
index 4aba4902c16af023f3ed20c0587b2b7a599e593f..7ccf3eef6cd0167af2a18ed68fd60e0346cbdbbc 100644
--- a/components/exo/keyboard.cc
+++ b/components/exo/keyboard.cc
@@ -4,7 +4,6 @@
#include "components/exo/keyboard.h"
-#include "ash/shell.h"
#include "components/exo/keyboard_delegate.h"
#include "components/exo/shell_surface.h"
#include "components/exo/surface.h"
@@ -74,20 +73,19 @@ bool ConsumedByIme(Surface* focus, const ui::KeyEvent* event) {
// Keyboard, public:
Keyboard::Keyboard(KeyboardDelegate* delegate) : delegate_(delegate) {
- ash::Shell::GetInstance()->AddPostTargetHandler(this);
- aura::client::FocusClient* focus_client =
- aura::client::GetFocusClient(ash::Shell::GetPrimaryRootWindow());
- focus_client->AddObserver(this);
- OnWindowFocused(focus_client->GetFocusedWindow(), nullptr);
+ auto* helper = WMHelper::GetInstance();
+ helper->AddPostTargetHandler(this);
+ helper->AddFocusObserver(this);
+ OnWindowFocused(helper->GetFocusedWindow(), nullptr);
}
Keyboard::~Keyboard() {
delegate_->OnKeyboardDestroying(this);
if (focus_)
focus_->RemoveSurfaceObserver(this);
- aura::client::GetFocusClient(ash::Shell::GetPrimaryRootWindow())
- ->RemoveObserver(this);
- ash::Shell::GetInstance()->RemovePostTargetHandler(this);
+ auto* helper = WMHelper::GetInstance();
+ helper->RemoveFocusObserver(this);
+ helper->RemovePostTargetHandler(this);
}
////////////////////////////////////////////////////////////////////////////////
« no previous file with comments | « components/exo/keyboard.h ('k') | components/exo/pointer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698