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

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: merge & add SessionStateDelegateChromeos Created 7 years, 6 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
« no previous file with comments | « chrome/browser/chromeos/profiles/profile_helper.cc ('k') | chrome/browser/ui/ash/chrome_shell_delegate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 0f2c5d40d92f453a3e89578911584fe1e597475c..e2ef3a9cb9d0550d8ddbfb7f5089c974a7d1fcd2 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 {
@@ -368,6 +374,8 @@ class SystemTrayDelegate : public ash::SystemTrayDelegate,
if (SystemKeyEventListener::GetInstance())
SystemKeyEventListener::GetInstance()->RemoveCapsLockObserver(this);
bluetooth_adapter_->RemoveObserver(this);
+ ash::Shell::GetInstance()->session_state_delegate()->
+ RemoveSessionStateObserver(this);
// Stop observing gdata operations.
DriveIntegrationService* integration_service =
@@ -1273,6 +1281,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();
« no previous file with comments | « chrome/browser/chromeos/profiles/profile_helper.cc ('k') | chrome/browser/ui/ash/chrome_shell_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698