summaryrefslogtreecommitdiffstats
path: root/ash/system/user/user_card_view.cc
diff options
context:
space:
mode:
authoroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-30 21:24:02 +0000
committeroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-30 21:24:02 +0000
commitfdf74bff8ca4b5b63e8af67e34d195a004a73300 (patch)
tree55dfb7e381468022a9d31bbddf6bc61e21cd3e59 /ash/system/user/user_card_view.cc
parent5f7e2b3d7e0212322d3b06b9623e9adb6ef37e67 (diff)
downloadchromium_src-fdf74bff8ca4b5b63e8af67e34d195a004a73300.zip
chromium_src-fdf74bff8ca4b5b63e8af67e34d195a004a73300.tar.gz
chromium_src-fdf74bff8ca4b5b63e8af67e34d195a004a73300.tar.bz2
CleanUp: Introduce UserInfo. Move session_state stuff to ash/session.
BUG=None R=nkostylev@chromium.org TBR=sky@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=267158 Review URL: https://codereview.chromium.org/253063002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@267337 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/system/user/user_card_view.cc')
-rw-r--r--ash/system/user/user_card_view.cc20
1 files changed, 12 insertions, 8 deletions
diff --git a/ash/system/user/user_card_view.cc b/ash/system/user/user_card_view.cc
index 6d5413e..af568ae 100644
--- a/ash/system/user/user_card_view.cc
+++ b/ash/system/user/user_card_view.cc
@@ -7,7 +7,8 @@
#include <algorithm>
#include <vector>
-#include "ash/session_state_delegate.h"
+#include "ash/session/session_state_delegate.h"
+#include "ash/session/user_info.h"
#include "ash/shell.h"
#include "ash/system/tray/system_tray_delegate.h"
#include "ash/system/tray/tray_constants.h"
@@ -89,8 +90,10 @@ PublicAccountUserDetails::PublicAccountUserDetails(int max_width)
// Retrieve the user's display name and wrap it with markers.
// Note that since this is a public account it always has to be the primary
// user.
- base::string16 display_name =
- Shell::GetInstance()->session_state_delegate()->GetUserDisplayName(0);
+ base::string16 display_name = Shell::GetInstance()
+ ->session_state_delegate()
+ ->GetUserInfo(0)
+ ->GetDisplayName();
base::RemoveChars(display_name, kDisplayNameMark, &display_name);
display_name = kDisplayNameMark[0] + display_name + kDisplayNameMark[0];
// Retrieve the domain managing the device and wrap it with markers.
@@ -305,10 +308,10 @@ void UserCardView::AddUserContent(user::LoginStatus login_status,
base::string16 user_name_string =
login_status == user::LOGGED_IN_GUEST
? l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_GUEST_LABEL)
- : delegate->GetUserDisplayName(multiprofile_index);
+ : delegate->GetUserInfo(multiprofile_index)->GetDisplayName();
if (user_name_string.empty() && IsMultiAccountSupportedAndUserActive())
- user_name_string =
- base::ASCIIToUTF16(delegate->GetUserEmail(multiprofile_index));
+ user_name_string = base::ASCIIToUTF16(
+ delegate->GetUserInfo(multiprofile_index)->GetEmail());
if (!user_name_string.empty()) {
username = new views::Label(user_name_string);
username->SetHorizontalAlignment(gfx::ALIGN_LEFT);
@@ -322,7 +325,8 @@ void UserCardView::AddUserContent(user::LoginStatus login_status,
login_status == user::LOGGED_IN_LOCALLY_MANAGED
? l10n_util::GetStringUTF16(
IDS_ASH_STATUS_TRAY_LOCALLY_MANAGED_LABEL)
- : base::UTF8ToUTF16(delegate->GetUserEmail(multiprofile_index));
+ : base::UTF8ToUTF16(
+ delegate->GetUserInfo(multiprofile_index)->GetEmail());
if (!user_email_string.empty()) {
additional = new views::Label(user_email_string);
additional->SetFontList(
@@ -372,7 +376,7 @@ views::View* UserCardView::CreateIcon(user::LoginStatus login_status,
Shell::GetInstance()->session_state_delegate();
content::BrowserContext* context =
delegate->GetBrowserContextByIndex(multiprofile_index);
- icon->SetImage(delegate->GetUserImage(context),
+ icon->SetImage(delegate->GetUserInfo(context)->GetImage(),
gfx::Size(kTrayAvatarSize, kTrayAvatarSize));
}
return icon;