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

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

Issue 9561003: ash uber tray: Add a tray item for the user. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: GetUserDisplayName instead of GetUserName Created 8 years, 10 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 | « ash/system/tray_user.cc ('k') | no next file » | 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 8e0adbbcfb33b84dbcc3b8acf81ccd4984b833f7..4c1a6f0958f05a5e8c6c6278c6f15056762289a8 100644
--- a/chrome/browser/chromeos/system/ash_system_tray_delegate.cc
+++ b/chrome/browser/chromeos/system/ash_system_tray_delegate.cc
@@ -13,6 +13,8 @@
#include "chrome/browser/chromeos/audio/audio_handler.h"
#include "chrome/browser/chromeos/dbus/dbus_thread_manager.h"
#include "chrome/browser/chromeos/dbus/power_manager_client.h"
+#include "chrome/browser/chromeos/login/user.h"
+#include "chrome/browser/chromeos/login/user_manager.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_list.h"
@@ -35,6 +37,18 @@ class SystemTrayDelegate : public ash::SystemTrayDelegate,
}
// Overridden from ash::SystemTrayDelegate.
+ virtual const std::string GetUserDisplayName() OVERRIDE {
+ return UserManager::Get()->logged_in_user().GetDisplayName();
+ }
+
+ virtual const std::string GetUserEmail() OVERRIDE {
+ return UserManager::Get()->logged_in_user().email();
+ }
+
+ virtual const SkBitmap& GetUserImage() OVERRIDE {
+ return UserManager::Get()->logged_in_user().image();
+ }
+
virtual void ShowSettings() OVERRIDE {
BrowserList::GetLastActive()->OpenOptionsDialog();
}
@@ -59,6 +73,19 @@ class SystemTrayDelegate : public ash::SystemTrayDelegate,
AudioHandler::GetInstance()->SetVolumePercent(level * 100.f);
}
+ virtual void ShutDown() OVERRIDE {
+ DBusThreadManager::Get()->GetPowerManagerClient()->RequestShutdown();
+ }
+
+ virtual void SignOut() OVERRIDE {
+ BrowserList::AttemptUserExit();
+ }
+
+ virtual void LockScreen() OVERRIDE {
+ DBusThreadManager::Get()->GetPowerManagerClient()->
+ NotifyScreenLockRequested();
+ }
+
private:
ash::SystemTray* tray_;
« no previous file with comments | « ash/system/tray_user.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698