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

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

Issue 2699033002: Replace WmWindowObserver with aura::WindowObserver. (Closed)
Patch Set: Check for null images in ShelfWindowWatcher. Created 3 years, 10 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 | « ash/common/wm/mru_window_tracker.h ('k') | ash/common/wm/overview/window_grid.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 8378500272be869f49e1b6eaa1f5e6bf947d21cb..df687d8fce167c7ddf8f9fc1a3fa57df060be47c 100644
--- a/ash/common/wm/mru_window_tracker.cc
+++ b/ash/common/wm/mru_window_tracker.cc
@@ -13,6 +13,7 @@
#include "ash/common/wm_window.h"
#include "ash/public/cpp/shell_window_ids.h"
#include "base/bind.h"
+#include "ui/aura/window.h"
namespace ash {
@@ -104,7 +105,7 @@ MruWindowTracker::MruWindowTracker() : ignore_window_activations_(false) {
MruWindowTracker::~MruWindowTracker() {
WmShell::Get()->RemoveActivationObserver(this);
for (WmWindow* window : mru_windows_)
- window->RemoveObserver(this);
+ window->aura_window()->RemoveObserver(this);
}
MruWindowTracker::WindowList MruWindowTracker::BuildMruWindowList() const {
@@ -137,7 +138,7 @@ void MruWindowTracker::SetActiveWindow(WmWindow* active_window) {
std::find(mru_windows_.begin(), mru_windows_.end(), active_window);
// Observe all newly tracked windows.
if (iter == mru_windows_.end())
- active_window->AddObserver(this);
+ active_window->aura_window()->AddObserver(this);
else
mru_windows_.erase(iter);
mru_windows_.push_front(active_window);
@@ -149,11 +150,11 @@ void MruWindowTracker::OnWindowActivated(WmWindow* gained_active,
SetActiveWindow(gained_active);
}
-void MruWindowTracker::OnWindowDestroyed(WmWindow* window) {
+void MruWindowTracker::OnWindowDestroyed(aura::Window* window) {
// It's possible for OnWindowActivated() to be called after
// OnWindowDestroying(). This means we need to override OnWindowDestroyed()
// else we may end up with a deleted window in |mru_windows_|.
- mru_windows_.remove(window);
+ mru_windows_.remove(WmWindow::Get(window));
window->RemoveObserver(this);
}
« no previous file with comments | « ash/common/wm/mru_window_tracker.h ('k') | ash/common/wm/overview/window_grid.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698