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

Unified Diff: chrome/browser/ui/ash/session_state_delegate_views.cc

Issue 253063002: CleanUp: Introduce UserInfo. Move session_state stuff to ash/session. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix tests Created 6 years, 8 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/ui/ash/session_state_delegate_views.cc
diff --git a/chrome/browser/ui/ash/session_state_delegate_views.cc b/chrome/browser/ui/ash/session_state_delegate_views.cc
index e3e86b17dfcfb80b59885a46b713163f67331097..2be43895af3d730ab1212f01a4b6f455403823ef 100644
--- a/chrome/browser/ui/ash/session_state_delegate_views.cc
+++ b/chrome/browser/ui/ash/session_state_delegate_views.cc
@@ -4,15 +4,50 @@
#include "chrome/browser/ui/ash/session_state_delegate_views.h"
+#include "ash/session/user_info.h"
#include "base/logging.h"
#include "base/strings/string16.h"
#include "base/strings/utf_string_conversions.h"
#include "ui/gfx/image/image_skia.h"
namespace {
-// This isn't really used. It is mainly here to make the compiler happy.
-gfx::ImageSkia null_image;
-}
+
+class EmptyUserInfo : public ash::UserInfo {
+ public:
+ EmptyUserInfo() {}
+ virtual ~EmptyUserInfo() {}
+
+ // ash::UserInfo:
+ virtual base::string16 GetDisplayName() const OVERRIDE {
+ NOTIMPLEMENTED();
+ return base::UTF8ToUTF16(std::string());
+ }
+ virtual base::string16 GetGivenName() const OVERRIDE {
+ NOTIMPLEMENTED();
+ return base::UTF8ToUTF16(std::string());
+ }
+ virtual std::string GetEmail() const OVERRIDE {
+ NOTIMPLEMENTED();
+ return std::string();
+ }
+ virtual std::string GetUserID() const OVERRIDE {
+ NOTIMPLEMENTED();
+ return std::string();
+ }
+
+ virtual const gfx::ImageSkia& GetImage() const OVERRIDE {
+ NOTIMPLEMENTED();
+ // To make the compiler happy.
+ return null_image_;
+ }
+
+ private:
+ const gfx::ImageSkia null_image_;
+
+ DISALLOW_COPY_AND_ASSIGN(EmptyUserInfo);
+};
+
+} // namespace
SessionStateDelegate::SessionStateDelegate() {
}
@@ -71,38 +106,18 @@ ash::SessionStateDelegate::SessionState SessionStateDelegate::GetSessionState()
return SESSION_STATE_ACTIVE;
}
-const base::string16 SessionStateDelegate::GetUserDisplayName(
- ash::MultiProfileIndex index) const {
- NOTIMPLEMENTED();
- return base::UTF8ToUTF16("");
-}
-
-const base::string16 SessionStateDelegate::GetUserGivenName(
- ash::MultiProfileIndex index) const {
- NOTIMPLEMENTED();
- return base::UTF8ToUTF16("");
-}
-
-const std::string SessionStateDelegate::GetUserEmail(
- ash::MultiProfileIndex index) const {
- NOTIMPLEMENTED();
- return "";
-}
-
-const std::string SessionStateDelegate::GetUserID(
+const ash::UserInfo* SessionStateDelegate::GetUserInfo(
ash::MultiProfileIndex index) const {
- NOTIMPLEMENTED();
- return "";
+ return GetUserInfo(NULL);
}
-const gfx::ImageSkia& SessionStateDelegate::GetUserImage(
+const ash::UserInfo* SessionStateDelegate::GetUserInfo(
content::BrowserContext* context) const {
- NOTIMPLEMENTED();
- // To make the compiler happy.
- return null_image;
+ static const ash::UserInfo* kUserInfo = new EmptyUserInfo();
+ return kUserInfo;
}
-bool SessionStateDelegate::ShouldShowAvatar(aura::Window* window) {
+bool SessionStateDelegate::ShouldShowAvatar(aura::Window* window) const {
return false;
}
« no previous file with comments | « chrome/browser/ui/ash/session_state_delegate_views.h ('k') | chrome/browser/ui/ash/system_tray_delegate_chromeos.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698