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

Unified Diff: ash/common/wm/mru_window_tracker.cc

Issue 2736753005: Converts WmActivationObserver to aura::client::ActivationChangeObserver (Closed)
Patch Set: cleanup 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
Index: ash/common/wm/mru_window_tracker.cc
diff --git a/ash/common/wm/mru_window_tracker.cc b/ash/common/wm/mru_window_tracker.cc
index df687d8fce167c7ddf8f9fc1a3fa57df060be47c..eb6a7953eab6d4f49c12e554c225e3c9927cbf96 100644
--- a/ash/common/wm/mru_window_tracker.cc
+++ b/ash/common/wm/mru_window_tracker.cc
@@ -12,8 +12,10 @@
#include "ash/common/wm_shell.h"
#include "ash/common/wm_window.h"
#include "ash/public/cpp/shell_window_ids.h"
+#include "ash/shell.h"
#include "base/bind.h"
#include "ui/aura/window.h"
+#include "ui/wm/public/activation_client.h"
namespace ash {
@@ -99,11 +101,11 @@ MruWindowTracker::WindowList BuildWindowListInternal(
// MruWindowTracker, public:
MruWindowTracker::MruWindowTracker() : ignore_window_activations_(false) {
- WmShell::Get()->AddActivationObserver(this);
+ Shell::GetInstance()->activation_client()->AddObserver(this);
}
MruWindowTracker::~MruWindowTracker() {
- WmShell::Get()->RemoveActivationObserver(this);
+ Shell::GetInstance()->activation_client()->RemoveObserver(this);
for (WmWindow* window : mru_windows_)
window->aura_window()->RemoveObserver(this);
}
@@ -144,10 +146,11 @@ void MruWindowTracker::SetActiveWindow(WmWindow* active_window) {
mru_windows_.push_front(active_window);
}
-void MruWindowTracker::OnWindowActivated(WmWindow* gained_active,
- WmWindow* lost_active) {
+void MruWindowTracker::OnWindowActivated(ActivationReason reason,
+ aura::Window* gained_active,
+ aura::Window* lost_active) {
if (!ignore_window_activations_)
- SetActiveWindow(gained_active);
+ SetActiveWindow(WmWindow::Get(gained_active));
}
void MruWindowTracker::OnWindowDestroyed(aura::Window* window) {

Powered by Google App Engine
This is Rietveld 408576698