diff options
Diffstat (limited to 'chrome/browser/ui/ash/multi_user')
6 files changed, 24 insertions, 40 deletions
diff --git a/chrome/browser/ui/ash/multi_user/multi_user_context_menu_chromeos.cc b/chrome/browser/ui/ash/multi_user/multi_user_context_menu_chromeos.cc index 8d56f0a..84a5fd7 100644 --- a/chrome/browser/ui/ash/multi_user/multi_user_context_menu_chromeos.cc +++ b/chrome/browser/ui/ash/multi_user/multi_user_context_menu_chromeos.cc @@ -5,7 +5,7 @@ #include "chrome/browser/ui/ash/multi_user/multi_user_context_menu.h" #include "ash/multi_profile_uma.h" -#include "ash/session/session_state_delegate.h" +#include "ash/session_state_delegate.h" #include "ash/shell.h" #include "base/bind.h" #include "base/callback.h" @@ -87,13 +87,13 @@ scoped_ptr<ui::MenuModel> CreateMultiUserContextMenu(aura::Window* window) { new chromeos::MultiUserContextMenuChromeos(window); model.reset(menu); for (int user_index = 1; user_index < logged_in_users; ++user_index) { - const ash::UserInfo* user_info = delegate->GetUserInfo(user_index); - menu->AddItem(user_index == 1 ? IDC_VISIT_DESKTOP_OF_LRU_USER_2 - : IDC_VISIT_DESKTOP_OF_LRU_USER_3, - l10n_util::GetStringFUTF16( - IDS_VISIT_DESKTOP_OF_LRU_USER, - user_info->GetDisplayName(), - base::ASCIIToUTF16(user_info->GetEmail()))); + menu->AddItem( + user_index == 1 ? IDC_VISIT_DESKTOP_OF_LRU_USER_2 : + IDC_VISIT_DESKTOP_OF_LRU_USER_3, + l10n_util::GetStringFUTF16( + IDS_VISIT_DESKTOP_OF_LRU_USER, + delegate->GetUserDisplayName(user_index), + base::ASCIIToUTF16(delegate->GetUserEmail(user_index)))); } } return model.Pass(); @@ -118,11 +118,8 @@ void ExecuteVisitDesktopCommand(int command_id, aura::Window* window) { // When running the multi user mode on Chrome OS, windows can "visit" // another user's desktop. const std::string& user_id = - ash::Shell::GetInstance() - ->session_state_delegate() - ->GetUserInfo(IDC_VISIT_DESKTOP_OF_LRU_USER_2 == command_id ? 1 - : 2) - ->GetUserID(); + ash::Shell::GetInstance()->session_state_delegate()->GetUserID( + IDC_VISIT_DESKTOP_OF_LRU_USER_2 == command_id ? 1 : 2); base::Callback<void(bool)> on_accept = base::Bind(&OnAcceptTeleportWarning, user_id, window); diff --git a/chrome/browser/ui/ash/multi_user/multi_user_notification_blocker_chromeos_unittest.cc b/chrome/browser/ui/ash/multi_user/multi_user_notification_blocker_chromeos_unittest.cc index aa5e7c6..2d1bc91 100644 --- a/chrome/browser/ui/ash/multi_user/multi_user_notification_blocker_chromeos_unittest.cc +++ b/chrome/browser/ui/ash/multi_user/multi_user_notification_blocker_chromeos_unittest.cc @@ -2,8 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#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/system_notifier.h" #include "ash/test/ash_test_base.h" @@ -65,10 +64,7 @@ class MultiUserNotificationBlockerChromeOSTest } const std::string GetDefaultUserId() { - return ash::Shell::GetInstance() - ->session_state_delegate() - ->GetUserInfo(0) - ->GetUserID(); + return ash::Shell::GetInstance()->session_state_delegate()->GetUserID(0); } const message_center::NotificationBlocker* blocker() { diff --git a/chrome/browser/ui/ash/multi_user/multi_user_window_manager.cc b/chrome/browser/ui/ash/multi_user/multi_user_window_manager.cc index 93b2af1..fc269782 100644 --- a/chrome/browser/ui/ash/multi_user/multi_user_window_manager.cc +++ b/chrome/browser/ui/ash/multi_user/multi_user_window_manager.cc @@ -10,8 +10,7 @@ #if defined(OS_CHROMEOS) #include "ash/ash_switches.h" #include "ash/multi_profile_uma.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 "chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos.h" @@ -42,11 +41,8 @@ MultiUserWindowManager* MultiUserWindowManager::CreateInstance() { ash::MultiProfileUMA::SESSION_SINGLE_USER_MODE; if (!g_instance && ash::Shell::GetInstance()->delegate()->IsMultiProfilesEnabled()) { - g_instance = - new MultiUserWindowManagerChromeOS(ash::Shell::GetInstance() - ->session_state_delegate() - ->GetUserInfo(0) - ->GetUserID()); + g_instance = new MultiUserWindowManagerChromeOS( + ash::Shell::GetInstance()->session_state_delegate()->GetUserID(0)); multi_user_mode_ = MULTI_PROFILE_MODE_SEPARATED; mode = ash::MultiProfileUMA::SESSION_SEPARATE_DESKTOP_MODE; } else if (ash::Shell::GetInstance()->delegate()->IsMultiProfilesEnabled()) { diff --git a/chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos.cc b/chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos.cc index 50480bcc..d1e344e4 100644 --- a/chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos.cc +++ b/chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos.cc @@ -9,7 +9,7 @@ #include "ash/ash_switches.h" #include "ash/multi_profile_uma.h" #include "ash/root_window_controller.h" -#include "ash/session/session_state_delegate.h" +#include "ash/session_state_delegate.h" #include "ash/shelf/shelf.h" #include "ash/shell.h" #include "ash/shell_delegate.h" diff --git a/chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos.h b/chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos.h index 4812431..66a89cc 100644 --- a/chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos.h +++ b/chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos.h @@ -8,7 +8,7 @@ #include <map> #include <string> -#include "ash/session/session_state_observer.h" +#include "ash/session_state_observer.h" #include "base/compiler_specific.h" #include "base/memory/scoped_ptr.h" #include "base/observer_list.h" diff --git a/chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos_unittest.cc b/chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos_unittest.cc index 8dc3171..44fe75c 100644 --- a/chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos_unittest.cc +++ b/chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos_unittest.cc @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ash/session/user_info.h" #include "ash/shell.h" #include "ash/shell_window_ids.h" #include "ash/test/ash_test_base.h" @@ -103,8 +102,7 @@ class MultiUserWindowManagerChromeOSTest : public AshTestBase { // manager. This function gets the current user from it and also sets it to // the multi user window manager. std::string GetAndValidateCurrentUserFromSessionStateObserver() { - const std::string& user = - session_state_delegate()->GetActiveUserInfo()->GetUserID(); + const std::string& user = session_state_delegate()->get_activated_user(); if (user != multi_user_window_manager_->GetCurrentUserForTest()) multi_user_window_manager()->ActiveUserChanged(user); return user; @@ -150,9 +148,6 @@ void MultiUserWindowManagerChromeOSTest::SetUp() { session_state_delegate_ = static_cast<TestSessionStateDelegate*> ( ash::Shell::GetInstance()->session_state_delegate()); - session_state_delegate_->AddUser("a"); - session_state_delegate_->AddUser("b"); - session_state_delegate_->AddUser("c"); } void MultiUserWindowManagerChromeOSTest::SetUpForThisManyWindows(int windows) { @@ -648,11 +643,11 @@ TEST_F(MultiUserWindowManagerChromeOSTest, SwitchUsersUponModalityChange) { // Making the window system modal should not change anything. MakeWindowSystemModal(window(0)); - EXPECT_EQ("a", session_state_delegate()->GetActiveUserInfo()->GetUserID()); + EXPECT_EQ("a", session_state_delegate()->get_activated_user()); // Making the window owned by user B should switch users. multi_user_window_manager()->SetWindowOwner(window(0), "b"); - EXPECT_EQ("b", session_state_delegate()->GetActiveUserInfo()->GetUserID()); + EXPECT_EQ("b", session_state_delegate()->get_activated_user()); } // Test that a system modal dialog will not switch desktop if active user has @@ -663,11 +658,11 @@ TEST_F(MultiUserWindowManagerChromeOSTest, DontSwitchUsersUponModalityChange) { // Making the window system modal should not change anything. MakeWindowSystemModal(window(0)); - EXPECT_EQ("a", session_state_delegate()->GetActiveUserInfo()->GetUserID()); + EXPECT_EQ("a", session_state_delegate()->get_activated_user()); // Making the window owned by user a should not switch users. multi_user_window_manager()->SetWindowOwner(window(0), "a"); - EXPECT_EQ("a", session_state_delegate()->GetActiveUserInfo()->GetUserID()); + EXPECT_EQ("a", session_state_delegate()->get_activated_user()); } // Test that a system modal dialog will not switch if shown on correct desktop @@ -683,7 +678,7 @@ TEST_F(MultiUserWindowManagerChromeOSTest, MakeWindowSystemModal(window(0)); // Showing the window should trigger no user switch. window(0)->Show(); - EXPECT_EQ("a", session_state_delegate()->GetActiveUserInfo()->GetUserID()); + EXPECT_EQ("a", session_state_delegate()->get_activated_user()); } // Test that a system modal dialog will switch if shown on incorrect desktop but @@ -699,7 +694,7 @@ TEST_F(MultiUserWindowManagerChromeOSTest, MakeWindowSystemModal(window(0)); // Showing the window should trigger a user switch. window(0)->Show(); - EXPECT_EQ("b", session_state_delegate()->GetActiveUserInfo()->GetUserID()); + EXPECT_EQ("b", session_state_delegate()->get_activated_user()); } // Test that using the full user switch animations are working as expected. |