Chromium Code Reviews| Index: chrome/browser/chromeos/system/ash_system_tray_delegate.cc |
| diff --git a/chrome/browser/chromeos/system/ash_system_tray_delegate.cc b/chrome/browser/chromeos/system/ash_system_tray_delegate.cc |
| index fb75489bc793385a3cbe359ed7f5142055d439df..8bf4b525815489658cc7482107a469cbf14e2b76 100644 |
| --- a/chrome/browser/chromeos/system/ash_system_tray_delegate.cc |
| +++ b/chrome/browser/chromeos/system/ash_system_tray_delegate.cc |
| @@ -11,6 +11,8 @@ |
| #include "ash/ash_switches.h" |
| #include "ash/desktop_background/desktop_background_controller.h" |
| +#include "ash/session_state_delegate.h" |
| +#include "ash/session_state_observer.h" |
| #include "ash/shell.h" |
| #include "ash/shell_delegate.h" |
| #include "ash/shell_window_ids.h" |
| @@ -235,7 +237,8 @@ class SystemTrayDelegate : public ash::SystemTrayDelegate, |
| public device::BluetoothAdapter::Observer, |
| public SystemKeyEventListener::CapsLockObserver, |
| public ash::NetworkTrayDelegate, |
| - public policy::CloudPolicyStore::Observer { |
| + public policy::CloudPolicyStore::Observer, |
| + public ash::SessionStateObserver { |
| public: |
| SystemTrayDelegate() |
| : ui_weak_ptr_factory_( |
| @@ -309,6 +312,9 @@ class SystemTrayDelegate : public ash::SystemTrayDelegate, |
| device::BluetoothAdapterFactory::GetAdapter( |
| base::Bind(&SystemTrayDelegate::InitializeOnAdapterReady, |
| ui_weak_ptr_factory_->GetWeakPtr())); |
| + |
| + ash::Shell::GetInstance()->session_state_delegate()-> |
| + AddSessionStateObserver(this); |
|
stevenjb
2013/06/03 16:52:00
We should remove this observer in the destructor.
Nikita (slow)
2013/06/04 12:41:33
Done.
|
| } |
| virtual void Shutdown() OVERRIDE { |
| @@ -1274,6 +1280,11 @@ class SystemTrayDelegate : public ash::SystemTrayDelegate, |
| UpdateEnterpriseDomain(); |
| } |
| + // Overridden from ash::SessionStateObserver |
| + virtual void ActiveUserChanged(const std::string& user_id) OVERRIDE { |
| + GetSystemTrayNotifier()->NotifyUserUpdate(); |
| + } |
| + |
| void UpdateCellular() { |
| const CellularNetworkVector& cellular_networks = |
| CrosLibrary::Get()->GetNetworkLibrary()->cellular_networks(); |