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

Unified Diff: components/exo/gamepad.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: Update 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
Index: components/exo/gamepad.cc
diff --git a/components/exo/gamepad.cc b/components/exo/gamepad.cc
index c7a5f562d275bb5dda7a217afe72ca411209aefe..876d05d809a2510353821a221aaca768e8f24642 100644
--- a/components/exo/gamepad.cc
+++ b/components/exo/gamepad.cc
@@ -6,7 +6,6 @@
#include <cmath>
-#include "ash/shell.h"
#include "base/bind.h"
#include "base/location.h"
#include "base/single_thread_task_runner.h"
@@ -18,7 +17,6 @@
#include "device/gamepad/gamepad_data_fetcher.h"
#include "device/gamepad/gamepad_pad_state_provider.h"
#include "device/gamepad/gamepad_platform_data_fetcher_linux.h"
-#include "ui/aura/client/focus_client.h"
#include "ui/aura/window.h"
namespace exo {
@@ -208,10 +206,9 @@ Gamepad::Gamepad(GamepadDelegate* delegate,
base::Bind(&Gamepad::ProcessGamepadChanges, weak_factory_.GetWeakPtr()),
create_fetcher_callback, polling_task_runner);
- 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->AddFocusObserver(this);
+ OnWindowFocused(helper->GetFocusedWindow(), nullptr);
}
Gamepad::~Gamepad() {
@@ -220,8 +217,7 @@ Gamepad::~Gamepad() {
gamepad_change_fetcher_->EnablePolling(false);
delegate_->OnGamepadDestroying(this);
- aura::client::GetFocusClient(ash::Shell::GetPrimaryRootWindow())
- ->RemoveObserver(this);
+ WMHelper::GetInstance()->RemoveFocusObserver(this);
}
////////////////////////////////////////////////////////////////////////////////
« no previous file with comments | « components/exo/gamepad.h ('k') | components/exo/keyboard.h » ('j') | components/exo/wm_helper.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698