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

Unified Diff: chrome/browser/chromeos/system/ash_system_tray_delegate.cc

Issue 15718003: Add SessionStateObserver with ActiveUserChanged() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: close button when switching users, notify observers with ActiveUserChanged() when new user logs in Created 7 years, 7 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/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 3321b495522208e76c1dcd9cb995bbe486776ead..b5c90eeb0eae5a8de2829ab867497380739843a3 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);
}
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();

Powered by Google App Engine
This is Rietveld 408576698