Index: ash/system/overview/overview_button_tray.cc |
diff --git a/ash/system/overview/overview_button_tray.cc b/ash/system/overview/overview_button_tray.cc |
index edd5d67dd0697dd2598133cc5289d83e7511831f..3b34aea30e90074bcd985fafa5ea70492f8c7892 100644 |
--- a/ash/system/overview/overview_button_tray.cc |
+++ b/ash/system/overview/overview_button_tray.cc |
@@ -4,6 +4,7 @@ |
#include "ash/system/overview/overview_button_tray.h" |
+#include "ash/session/session_state_delegate.h" |
#include "ash/shelf/shelf_types.h" |
#include "ash/shell.h" |
#include "ash/system/tray/system_tray_delegate.h" |
@@ -42,10 +43,13 @@ OverviewButtonTray::OverviewButtonTray(StatusAreaWidget* status_area_widget) |
tray_container()->AddChildView(icon_); |
Shell::GetInstance()->AddShellObserver(this); |
+ Shell::GetInstance()->session_state_delegate()->AddSessionStateObserver(this); |
} |
OverviewButtonTray::~OverviewButtonTray() { |
Shell::GetInstance()->RemoveShellObserver(this); |
+ Shell::GetInstance()->session_state_delegate()->RemoveSessionStateObserver( |
+ this); |
} |
void OverviewButtonTray::UpdateAfterLoginStatusChange( |
@@ -62,6 +66,11 @@ bool OverviewButtonTray::PerformAction(const ui::Event& event) { |
return true; |
} |
+void OverviewButtonTray::SessionStateChanged( |
+ SessionStateDelegate::SessionState state) { |
+ UpdateIconVisibility(); |
flackr
2015/05/28 15:20:37
I think this is getting brittle, the logic / respo
jonross
2015/06/01 17:00:37
I've decided to decouple OverviewButton's visibili
|
+} |
+ |
void OverviewButtonTray::OnMaximizeModeStarted() { |
UpdateIconVisibility(); |
} |