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

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

Issue 375413002: Replace chromeos::UserManager::Get() with chromeos::GetUserManager(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix test Created 6 years, 5 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_chromeos.cc
diff --git a/chrome/browser/ui/ash/session_state_delegate_chromeos.cc b/chrome/browser/ui/ash/session_state_delegate_chromeos.cc
index ad073e65da68519e4bbd220fbcef762bbb2a3ed7..0aad17e069121efd6c2851900d3c721b51572c4e 100644
--- a/chrome/browser/ui/ash/session_state_delegate_chromeos.cc
+++ b/chrome/browser/ui/ash/session_state_delegate_chromeos.cc
@@ -26,7 +26,7 @@
SessionStateDelegateChromeos::SessionStateDelegateChromeos()
: session_state_(SESSION_STATE_LOGIN_PRIMARY) {
- chromeos::UserManager::Get()->AddSessionStateObserver(this);
+ chromeos::GetUserManager()->AddSessionStateObserver(this);
chromeos::UserAddingScreen::Get()->AddObserver(this);
// LoginState is not initialized in unit_tests.
@@ -38,7 +38,7 @@ SessionStateDelegateChromeos::SessionStateDelegateChromeos()
}
SessionStateDelegateChromeos::~SessionStateDelegateChromeos() {
- chromeos::UserManager::Get()->RemoveSessionStateObserver(this);
+ chromeos::GetUserManager()->RemoveSessionStateObserver(this);
chromeos::UserAddingScreen::Get()->RemoveObserver(this);
// LoginState is not initialized in unit_tests.
@@ -50,7 +50,7 @@ content::BrowserContext* SessionStateDelegateChromeos::GetBrowserContextByIndex(
ash::MultiProfileIndex index) {
DCHECK_LT(index, NumberOfLoggedInUsers());
chromeos::User* user =
- chromeos::UserManager::Get()->GetLRULoggedInUsers()[index];
+ chromeos::GetUserManager()->GetLRULoggedInUsers()[index];
DCHECK(user);
return chromeos::ProfileHelper::Get()->GetProfileByUser(user);
}
@@ -60,7 +60,7 @@ SessionStateDelegateChromeos::GetBrowserContextForWindow(
aura::Window* window) {
const std::string& user_id =
chrome::MultiUserWindowManager::GetInstance()->GetWindowOwner(window);
- const chromeos::User* user = chromeos::UserManager::Get()->FindUser(user_id);
+ const chromeos::User* user = chromeos::GetUserManager()->FindUser(user_id);
DCHECK(user);
return chromeos::ProfileHelper::Get()->GetProfileByUser(user);
}
@@ -75,16 +75,16 @@ int SessionStateDelegateChromeos::GetMaximumNumberOfLoggedInUsers() const {
}
int SessionStateDelegateChromeos::NumberOfLoggedInUsers() const {
- return chromeos::UserManager::Get()->GetLoggedInUsers().size();
+ return chromeos::GetUserManager()->GetLoggedInUsers().size();
}
bool SessionStateDelegateChromeos::IsActiveUserSessionStarted() const {
- return chromeos::UserManager::Get()->IsSessionStarted();
+ return chromeos::GetUserManager()->IsSessionStarted();
}
bool SessionStateDelegateChromeos::CanLockScreen() const {
const chromeos::UserList unlock_users =
- chromeos::UserManager::Get()->GetUnlockUsers();
+ chromeos::GetUserManager()->GetUnlockUsers();
return !unlock_users.empty();
}
@@ -95,7 +95,7 @@ bool SessionStateDelegateChromeos::IsScreenLocked() const {
bool SessionStateDelegateChromeos::ShouldLockScreenBeforeSuspending() const {
const chromeos::UserList logged_in_users =
- chromeos::UserManager::Get()->GetLoggedInUsers();
+ chromeos::GetUserManager()->GetLoggedInUsers();
for (chromeos::UserList::const_iterator it = logged_in_users.begin();
it != logged_in_users.end(); ++it) {
chromeos::User* user = (*it);
@@ -136,7 +136,7 @@ SessionStateDelegateChromeos::GetSessionState() const {
const ash::UserInfo* SessionStateDelegateChromeos::GetUserInfo(
ash::MultiProfileIndex index) const {
DCHECK_LT(index, NumberOfLoggedInUsers());
- return chromeos::UserManager::Get()->GetLRULoggedInUsers()[index];
+ return chromeos::GetUserManager()->GetLRULoggedInUsers()[index];
}
const ash::UserInfo* SessionStateDelegateChromeos::GetUserInfo(
@@ -158,9 +158,9 @@ void SessionStateDelegateChromeos::SwitchActiveUser(
// Also check that we got a user id and not an email address.
DCHECK_EQ(user_id,
gaia::CanonicalizeEmail(gaia::SanitizeEmail(user_id)));
- if (user_id == chromeos::UserManager::Get()->GetActiveUser()->email())
+ if (user_id == chromeos::GetUserManager()->GetActiveUser()->email())
return;
- chromeos::UserManager::Get()->SwitchActiveUser(user_id);
+ chromeos::GetUserManager()->SwitchActiveUser(user_id);
}
void SessionStateDelegateChromeos::CycleActiveUser(CycleUser cycle_user) {
@@ -169,9 +169,9 @@ void SessionStateDelegateChromeos::CycleActiveUser(CycleUser cycle_user) {
return;
const chromeos::UserList& logged_in_users =
- chromeos::UserManager::Get()->GetLoggedInUsers();
+ chromeos::GetUserManager()->GetLoggedInUsers();
- std::string user_id = chromeos::UserManager::Get()->GetActiveUser()->email();
+ std::string user_id = chromeos::GetUserManager()->GetActiveUser()->email();
// Get an iterator positioned at the active user.
chromeos::UserList::const_iterator it;
@@ -202,7 +202,7 @@ void SessionStateDelegateChromeos::CycleActiveUser(CycleUser cycle_user) {
}
// Switch using the transformed |user_id|.
- chromeos::UserManager::Get()->SwitchActiveUser(user_id);
+ chromeos::GetUserManager()->SwitchActiveUser(user_id);
}
void SessionStateDelegateChromeos::AddSessionStateObserver(
« no previous file with comments | « chrome/browser/ui/ash/multi_user/multi_user_util.cc ('k') | chrome/browser/ui/ash/session_state_delegate_chromeos_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698