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

Unified Diff: ash/system/user/user_card_view.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
« no previous file with comments | « ash/system/user/tray_user_unittest.cc ('k') | ash/system/user/user_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/user/user_card_view.cc
diff --git a/ash/system/user/user_card_view.cc b/ash/system/user/user_card_view.cc
index 6d5413e4c693b003d3d63819195c1fb7ea4cb27b..af568aea427a25b8e4960531b90b5e5ed0426789 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;
« no previous file with comments | « ash/system/user/tray_user_unittest.cc ('k') | ash/system/user/user_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698