diff options
author | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-30 17:15:12 +0000 |
---|---|---|
committer | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-30 17:15:12 +0000 |
commit | 6e50d42bdd5307d76a90fb398774d140f796eace (patch) | |
tree | d27fdbdaf6106a62fa45a48e0543eff70dde6ae4 /ash/system | |
parent | 3d48423a74668a7cfd71ba895a2c510ec85447b5 (diff) | |
download | chromium_src-6e50d42bdd5307d76a90fb398774d140f796eace.zip chromium_src-6e50d42bdd5307d76a90fb398774d140f796eace.tar.gz chromium_src-6e50d42bdd5307d76a90fb398774d140f796eace.tar.bz2 |
Revert 267158 "CleanUp: Introduce UserInfo. Move session_state s..."
> CleanUp: Introduce UserInfo. Move session_state stuff to ash/session.
>
> BUG=None
> R=nkostylev@chromium.org
> TBR=sky@chromium.org
>
> Review URL: https://codereview.chromium.org/253063002
TBR=oshima@chromium.org
Review URL: https://codereview.chromium.org/260783002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@267250 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/system')
-rw-r--r-- | ash/system/chromeos/network/network_connect.cc | 2 | ||||
-rw-r--r-- | ash/system/chromeos/power/power_event_observer.cc | 2 | ||||
-rw-r--r-- | ash/system/chromeos/session/logout_confirmation_controller.cc | 2 | ||||
-rw-r--r-- | ash/system/date/date_default_view.cc | 2 | ||||
-rw-r--r-- | ash/system/tray/default_system_tray_delegate.cc | 2 | ||||
-rw-r--r-- | ash/system/user/accounts_detailed_view.cc | 14 | ||||
-rw-r--r-- | ash/system/user/config.cc | 2 | ||||
-rw-r--r-- | ash/system/user/login_status.cc | 2 | ||||
-rw-r--r-- | ash/system/user/tray_user.cc | 5 | ||||
-rw-r--r-- | ash/system/user/tray_user.h | 2 | ||||
-rw-r--r-- | ash/system/user/tray_user_separator.cc | 2 | ||||
-rw-r--r-- | ash/system/user/tray_user_unittest.cc | 7 | ||||
-rw-r--r-- | ash/system/user/user_card_view.cc | 20 | ||||
-rw-r--r-- | ash/system/user/user_view.cc | 5 | ||||
-rw-r--r-- | ash/system/user/user_view.h | 2 |
15 files changed, 29 insertions, 42 deletions
diff --git a/ash/system/chromeos/network/network_connect.cc b/ash/system/chromeos/network/network_connect.cc index d9e9bcf..64a5749 100644 --- a/ash/system/chromeos/network/network_connect.cc +++ b/ash/system/chromeos/network/network_connect.cc @@ -4,7 +4,7 @@ #include "ash/system/chromeos/network/network_connect.h" -#include "ash/session/session_state_delegate.h" +#include "ash/session_state_delegate.h" #include "ash/shell.h" #include "ash/system/chromeos/network/network_state_notifier.h" #include "ash/system/system_notifier.h" diff --git a/ash/system/chromeos/power/power_event_observer.cc b/ash/system/chromeos/power/power_event_observer.cc index 103d2df..776b004 100644 --- a/ash/system/chromeos/power/power_event_observer.cc +++ b/ash/system/chromeos/power/power_event_observer.cc @@ -4,7 +4,7 @@ #include "ash/system/chromeos/power/power_event_observer.h" -#include "ash/session/session_state_delegate.h" +#include "ash/session_state_delegate.h" #include "ash/shell.h" #include "ash/system/tray/system_tray_notifier.h" #include "ash/wm/power_button_controller.h" diff --git a/ash/system/chromeos/session/logout_confirmation_controller.cc b/ash/system/chromeos/session/logout_confirmation_controller.cc index fdf1cc6..61d8c9b 100644 --- a/ash/system/chromeos/session/logout_confirmation_controller.cc +++ b/ash/system/chromeos/session/logout_confirmation_controller.cc @@ -4,7 +4,7 @@ #include "ash/system/chromeos/session/logout_confirmation_controller.h" -#include "ash/session/session_state_delegate.h" +#include "ash/session_state_delegate.h" #include "ash/shell.h" #include "ash/system/chromeos/session/logout_confirmation_dialog.h" #include "base/location.h" diff --git a/ash/system/date/date_default_view.cc b/ash/system/date/date_default_view.cc index f9ed123..389485f 100644 --- a/ash/system/date/date_default_view.cc +++ b/ash/system/date/date_default_view.cc @@ -5,7 +5,7 @@ #include "ash/system/date/date_default_view.h" #include "ash/metrics/user_metrics_recorder.h" -#include "ash/session/session_state_delegate.h" +#include "ash/session_state_delegate.h" #include "ash/shell.h" #include "ash/system/date/date_view.h" #include "ash/system/tray/special_popup_row.h" diff --git a/ash/system/tray/default_system_tray_delegate.cc b/ash/system/tray/default_system_tray_delegate.cc index 1ac2c04..5b254c1 100644 --- a/ash/system/tray/default_system_tray_delegate.cc +++ b/ash/system/tray/default_system_tray_delegate.cc @@ -6,7 +6,7 @@ #include <string> -#include "ash/session/session_state_delegate.h" +#include "ash/session_state_delegate.h" #include "ash/shell.h" #include "ash/volume_control_delegate.h" #include "base/message_loop/message_loop.h" diff --git a/ash/system/user/accounts_detailed_view.cc b/ash/system/user/accounts_detailed_view.cc index 58956b5..fe5bb68 100644 --- a/ash/system/user/accounts_detailed_view.cc +++ b/ash/system/user/accounts_detailed_view.cc @@ -7,7 +7,6 @@ #include <vector> #include "ash/multi_profile_uma.h" -#include "ash/session/user_info.h" #include "ash/shell.h" #include "ash/system/tray/fixed_sized_scroll_view.h" #include "ash/system/tray/hover_highlight_view.h" @@ -44,10 +43,8 @@ AccountsDetailedView::AccountsDetailedView(TrayUser* owner, account_list_(NULL), add_account_button_(NULL), add_user_button_(NULL) { - std::string user_id = Shell::GetInstance() - ->session_state_delegate() - ->GetUserInfo(0) - ->GetUserID(); + std::string user_id = + Shell::GetInstance()->session_state_delegate()->GetUserID(0); delegate_ = Shell::GetInstance()->system_tray_delegate()->GetUserAccountsDelegate( user_id); @@ -120,12 +117,11 @@ void AccountsDetailedView::AddAddAccountButton() { SessionStateDelegate* session_state_delegate = Shell::GetInstance()->session_state_delegate(); HoverHighlightView* add_account_button = new HoverHighlightView(this); - const UserInfo* user_info = session_state_delegate->GetUserInfo(0); - base::string16 user_name = user_info->GetGivenName(); + base::string16 user_name = session_state_delegate->GetUserGivenName(0); if (user_name.empty()) - user_name = user_info->GetDisplayName(); + user_name = session_state_delegate->GetUserDisplayName(0); if (user_name.empty()) - user_name = base::ASCIIToUTF16(user_info->GetEmail()); + user_name = base::ASCIIToUTF16(session_state_delegate->GetUserEmail(0)); add_account_button->AddLabel( l10n_util::GetStringFUTF16(IDS_ASH_STATUS_TRAY_ADD_ACCOUNT_LABEL, user_name), diff --git a/ash/system/user/config.cc b/ash/system/user/config.cc index 1ea6d32..d704393 100644 --- a/ash/system/user/config.cc +++ b/ash/system/user/config.cc @@ -4,7 +4,7 @@ #include "ash/system/user/config.h" -#include "ash/session/session_state_delegate.h" +#include "ash/session_state_delegate.h" #include "ash/shell.h" #include "ash/shell_delegate.h" diff --git a/ash/system/user/login_status.cc b/ash/system/user/login_status.cc index 97c05c15..3172cd7 100644 --- a/ash/system/user/login_status.cc +++ b/ash/system/user/login_status.cc @@ -4,7 +4,7 @@ #include "ash/system/user/login_status.h" -#include "ash/session/session_state_delegate.h" +#include "ash/session_state_delegate.h" #include "ash/shell.h" #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" diff --git a/ash/system/user/tray_user.cc b/ash/system/user/tray_user.cc index cb5676c..2a8dfe1 100644 --- a/ash/system/user/tray_user.cc +++ b/ash/system/user/tray_user.cc @@ -6,8 +6,7 @@ #include "ash/ash_switches.h" #include "ash/root_window_controller.h" -#include "ash/session/session_state_delegate.h" -#include "ash/session/user_info.h" +#include "ash/session_state_delegate.h" #include "ash/shelf/shelf_layout_manager.h" #include "ash/shell_delegate.h" #include "ash/system/tray/system_tray.h" @@ -264,7 +263,7 @@ void TrayUser::UpdateAvatarImage(user::LoginStatus status) { content::BrowserContext* context = session_state_delegate-> GetBrowserContextByIndex(GetTrayIndex()); - avatar_->SetImage(session_state_delegate->GetUserInfo(context)->GetImage(), + avatar_->SetImage(session_state_delegate->GetUserImage(context), gfx::Size(kTrayAvatarSize, kTrayAvatarSize)); // Unit tests might come here with no images for some users. diff --git a/ash/system/user/tray_user.h b/ash/system/user/tray_user.h index 1e0aa281..0b19d47 100644 --- a/ash/system/user/tray_user.h +++ b/ash/system/user/tray_user.h @@ -6,7 +6,7 @@ #define ASH_SYSTEM_USER_TRAY_USER_H_ #include "ash/ash_export.h" -#include "ash/session/session_state_delegate.h" +#include "ash/session_state_delegate.h" #include "ash/system/tray/system_tray_item.h" #include "ash/system/user/user_observer.h" #include "base/compiler_specific.h" diff --git a/ash/system/user/tray_user_separator.cc b/ash/system/user/tray_user_separator.cc index 7058d2f..dd60f6b 100644 --- a/ash/system/user/tray_user_separator.cc +++ b/ash/system/user/tray_user_separator.cc @@ -4,7 +4,7 @@ #include "ash/system/user/tray_user_separator.h" -#include "ash/session/session_state_delegate.h" +#include "ash/session_state_delegate.h" #include "ash/shell.h" #include "ui/views/view.h" diff --git a/ash/system/user/tray_user_unittest.cc b/ash/system/user/tray_user_unittest.cc index 3205666..b0d77c4 100644 --- a/ash/system/user/tray_user_unittest.cc +++ b/ash/system/user/tray_user_unittest.cc @@ -6,7 +6,6 @@ #include "ash/ash_switches.h" #include "ash/root_window_controller.h" -#include "ash/session/user_info.h" #include "ash/shelf/shelf_layout_manager.h" #include "ash/shell.h" #include "ash/shell_delegate.h" @@ -239,12 +238,10 @@ TEST_F(TrayUserTest, MutiUserModeButtonClicks) { // Switch to a new user - which has a capitalized name. ClickUserItem(&generator, 1); - const UserInfo* active_user = delegate()->GetActiveUserInfo(); - const UserInfo* second_user = delegate()->GetUserInfo(1); - EXPECT_EQ(active_user->GetUserID(), second_user->GetUserID()); + EXPECT_EQ(delegate()->get_activated_user(), delegate()->GetUserID(1)); // Since the name is capitalized, the email should be different then the // user_id. - EXPECT_NE(active_user->GetUserID(), second_user->GetEmail()); + EXPECT_NE(delegate()->get_activated_user(), delegate()->GetUserEmail(1)); tray()->CloseSystemBubble(); } diff --git a/ash/system/user/user_card_view.cc b/ash/system/user/user_card_view.cc index af568ae..6d5413e 100644 --- a/ash/system/user/user_card_view.cc +++ b/ash/system/user/user_card_view.cc @@ -7,8 +7,7 @@ #include <algorithm> #include <vector> -#include "ash/session/session_state_delegate.h" -#include "ash/session/user_info.h" +#include "ash/session_state_delegate.h" #include "ash/shell.h" #include "ash/system/tray/system_tray_delegate.h" #include "ash/system/tray/tray_constants.h" @@ -90,10 +89,8 @@ 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() - ->GetUserInfo(0) - ->GetDisplayName(); + base::string16 display_name = + Shell::GetInstance()->session_state_delegate()->GetUserDisplayName(0); 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. @@ -308,10 +305,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->GetUserInfo(multiprofile_index)->GetDisplayName(); + : delegate->GetUserDisplayName(multiprofile_index); if (user_name_string.empty() && IsMultiAccountSupportedAndUserActive()) - user_name_string = base::ASCIIToUTF16( - delegate->GetUserInfo(multiprofile_index)->GetEmail()); + user_name_string = + base::ASCIIToUTF16(delegate->GetUserEmail(multiprofile_index)); if (!user_name_string.empty()) { username = new views::Label(user_name_string); username->SetHorizontalAlignment(gfx::ALIGN_LEFT); @@ -325,8 +322,7 @@ 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->GetUserInfo(multiprofile_index)->GetEmail()); + : base::UTF8ToUTF16(delegate->GetUserEmail(multiprofile_index)); if (!user_email_string.empty()) { additional = new views::Label(user_email_string); additional->SetFontList( @@ -376,7 +372,7 @@ views::View* UserCardView::CreateIcon(user::LoginStatus login_status, Shell::GetInstance()->session_state_delegate(); content::BrowserContext* context = delegate->GetBrowserContextByIndex(multiprofile_index); - icon->SetImage(delegate->GetUserInfo(context)->GetImage(), + icon->SetImage(delegate->GetUserImage(context), gfx::Size(kTrayAvatarSize, kTrayAvatarSize)); } return icon; diff --git a/ash/system/user/user_view.cc b/ash/system/user/user_view.cc index f5eb6833..4743163 100644 --- a/ash/system/user/user_view.cc +++ b/ash/system/user/user_view.cc @@ -8,8 +8,7 @@ #include "ash/multi_profile_uma.h" #include "ash/popup_message.h" -#include "ash/session/session_state_delegate.h" -#include "ash/session/user_info.h" +#include "ash/session_state_delegate.h" #include "ash/shell.h" #include "ash/shell_delegate.h" #include "ash/system/tray/system_tray.h" @@ -77,7 +76,7 @@ void SwitchUser(ash::MultiProfileIndex user_index) { ash::Shell::GetInstance()->session_state_delegate(); ash::MultiProfileUMA::RecordSwitchActiveUser( ash::MultiProfileUMA::SWITCH_ACTIVE_USER_BY_TRAY); - delegate->SwitchActiveUser(delegate->GetUserInfo(user_index)->GetUserID()); + delegate->SwitchActiveUser(delegate->GetUserID(user_index)); } class LogoutButton : public TrayPopupLabelButton { diff --git a/ash/system/user/user_view.h b/ash/system/user/user_view.h index b51b4c7..e6657c6 100644 --- a/ash/system/user/user_view.h +++ b/ash/system/user/user_view.h @@ -5,7 +5,7 @@ #ifndef ASH_SYSTEM_USER_USER_VIEW_H_ #define ASH_SYSTEM_USER_USER_VIEW_H_ -#include "ash/session/session_state_delegate.h" +#include "ash/session_state_delegate.h" #include "ash/system/tray/tray_constants.h" #include "ash/system/user/login_status.h" #include "ash/system/user/tray_user.h" |