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

Unified Diff: ash/common/wm_shell.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_shell.cc
diff --git a/ash/common/wm_shell.cc b/ash/common/wm_shell.cc
index 4f9f1e1943dca85bbe9a0eea2bef99e9de418219..6e141731fb9ae84631e261e609c388fd2de94c4d 100644
--- a/ash/common/wm_shell.cc
+++ b/ash/common/wm_shell.cc
@@ -46,7 +46,6 @@
#include "ash/common/wm/root_window_finder.h"
#include "ash/common/wm/system_modal_container_layout_manager.h"
#include "ash/common/wm/window_cycle_controller.h"
-#include "ash/common/wm_activation_observer.h"
#include "ash/common/wm_window.h"
#include "ash/public/cpp/shell_window_ids.h"
#include "ash/root_window_controller.h"
@@ -115,8 +114,7 @@ void WmShell::Initialize(const scoped_refptr<base::SequencedWorkerPool>& pool) {
}
void WmShell::Shutdown() {
- if (added_activation_observer_)
- Shell::GetInstance()->activation_client()->RemoveObserver(this);
+ Shell::GetInstance()->activation_client()->RemoveObserver(this);
// These members access WmShell in their destructors.
wallpaper_controller_.reset();
@@ -230,18 +228,6 @@ void WmShell::NotifyShelfAutoHideBehaviorChanged(WmWindow* root_window) {
observer.OnShelfAutoHideBehaviorChanged(root_window);
}
-void WmShell::AddActivationObserver(WmActivationObserver* observer) {
- if (!added_activation_observer_) {
- added_activation_observer_ = true;
- Shell::GetInstance()->activation_client()->AddObserver(this);
- }
- activation_observers_.AddObserver(observer);
-}
-
-void WmShell::RemoveActivationObserver(WmActivationObserver* observer) {
- activation_observers_.RemoveObserver(observer);
-}
-
void WmShell::AddShellObserver(ShellObserver* observer) {
shell_observers_.AddObserver(observer);
}
@@ -455,20 +441,10 @@ void WmShell::OnWindowActivated(
aura::client::ActivationChangeObserver::ActivationReason reason,
aura::Window* gained_active,
aura::Window* lost_active) {
+ // TODO(sky): Shell should implement ActivationChangeObserver, not WmShell.
WmWindow* gained_active_wm = WmWindow::Get(gained_active);
- WmWindow* lost_active_wm = WmWindow::Get(lost_active);
if (gained_active_wm)
set_root_window_for_new_windows(gained_active_wm->GetRootWindow());
- for (auto& observer : activation_observers_)
- observer.OnWindowActivated(gained_active_wm, lost_active_wm);
-}
-
-void WmShell::OnAttemptToReactivateWindow(aura::Window* request_active,
- aura::Window* actual_active) {
- for (auto& observer : activation_observers_) {
- observer.OnAttemptToReactivateWindow(WmWindow::Get(request_active),
- WmWindow::Get(actual_active));
- }
}
} // namespace ash

Powered by Google App Engine
This is Rietveld 408576698