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

Unified Diff: chrome/browser/chromeos/arc/boot_phase_monitor/arc_instance_throttle.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: chrome/browser/chromeos/arc/boot_phase_monitor/arc_instance_throttle.cc
diff --git a/chrome/browser/chromeos/arc/boot_phase_monitor/arc_instance_throttle.cc b/chrome/browser/chromeos/arc/boot_phase_monitor/arc_instance_throttle.cc
index 9f687f14bfbe02e362190e6c7380f8225e65e932..40bf04e79f45fc71d841020e2d62d00d5b9f8c74 100644
--- a/chrome/browser/chromeos/arc/boot_phase_monitor/arc_instance_throttle.cc
+++ b/chrome/browser/chromeos/arc/boot_phase_monitor/arc_instance_throttle.cc
@@ -7,10 +7,12 @@
#include "ash/common/wm_shell.h"
#include "ash/common/wm_window.h"
#include "ash/shared/app_types.h"
+#include "ash/shell.h"
#include "base/bind.h"
#include "base/logging.h"
#include "chromeos/dbus/dbus_thread_manager.h"
#include "chromeos/dbus/session_manager_client.h"
+#include "ui/wm/public/activation_client.h"
namespace arc {
@@ -50,21 +52,19 @@ void ThrottleInstanceIfNeeded(ash::WmWindow* active) {
} // namespace
ArcInstanceThrottle::ArcInstanceThrottle() {
- ash::WmShell* shell = ash::WmShell::Get();
- DCHECK(shell);
- shell->AddActivationObserver(this);
- ThrottleInstanceIfNeeded(shell->GetActiveWindow());
+ ash::Shell::GetInstance()->activation_client()->AddObserver(this);
+ ThrottleInstanceIfNeeded(ash::WmShell::Get()->GetActiveWindow());
}
ArcInstanceThrottle::~ArcInstanceThrottle() {
- ash::WmShell* shell = ash::WmShell::Get();
- if (shell)
- shell->RemoveActivationObserver(this);
+ if (ash::Shell::HasInstance())
+ ash::Shell::GetInstance()->activation_client()->RemoveObserver(this);
}
-void ArcInstanceThrottle::OnWindowActivated(ash::WmWindow* gained_active,
- ash::WmWindow* lost_active) {
- ThrottleInstanceIfNeeded(gained_active);
+void ArcInstanceThrottle::OnWindowActivated(ActivationReason reason,
+ aura::Window* gained_active,
+ aura::Window* lost_active) {
+ ThrottleInstanceIfNeeded(ash::WmWindow::Get(gained_active));
}
} // namespace arc
« ash/shell.cc ('K') | « chrome/browser/chromeos/arc/boot_phase_monitor/arc_instance_throttle.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698